- var drawHandler = new L.Rectangle.Draw(map, {title: I18n.t('browse.start_rjs.drag_a_box')});
- map.on('draw:rectangle-created', endDrag);
+ map.on('layeradd', function (e) {
+ if (e.layer === dataLayer) {
+ $.ajax({ url: "/browse/start", success: function (sidebarHtml) {
+ startBrowse(sidebarHtml);
+ }});
+ }
+ });
+
+ map.on('layerremove', function (e) {
+ if (e.layer === dataLayer) {
+ closeSidebar();
+ }
+ });
+
+ function startBrowse(sidebarHtml) {
+ locationFilter = new L.LocationFilter({
+ enableButton: false,
+ adjustButton: false
+ }).addTo(map);
+
+ locationFilter.on("change", getData);