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