Upstream pull request:
https://github.com/kajic/leaflet-locationfilter/pull/14
});
$(document).on("click", "a", function(e) {
- if (e.isPropagationStopped()) return;
+ if (e.isDefaultPrevented() || e.isPropagationStopped()) return;
if (this.host === window.location.host && OSM.route(this.pathname + this.search + this.hash)) e.preventDefault();
});
validateControls();
}
- function enableFilter() {
- if (!locationFilter.getBounds().isValid()) {
- locationFilter.setBounds(map.getBounds().pad(-0.2));
- }
+ function enableFilter(e) {
+ e.preventDefault();
$("#drag_box").hide();
+
+ locationFilter.setBounds(map.getBounds().pad(-0.2));
locationFilter.enable();
}
onAdd: function(map) {
this._map = map;
- this._layer = new L.LayerGroup();
if (this.options.enableButton || this.options.adjustButton) {
this._initializeButtonContainer();
return;
}
+ this._layer = new L.LayerGroup();
+
// Calculate filter bounds
this._calculateBounds();