X-Git-Url: https://git.openstreetmap.org/rails.git/blobdiff_plain/6bde69a840794523e54bdf1a3f99f0c413c0d974..10294f4849b5d97185c618687a710a2dfc19f148:/vendor/assets/leaflet/leaflet.locationfilter.js diff --git a/vendor/assets/leaflet/leaflet.locationfilter.js b/vendor/assets/leaflet/leaflet.locationfilter.js index a17f1a5af..64ca34712 100644 --- a/vendor/assets/leaflet/leaflet.locationfilter.js +++ b/vendor/assets/leaflet/leaflet.locationfilter.js @@ -90,9 +90,7 @@ L.Control.ButtonContainer = L.Control.extend({ } }); -L.LocationFilter = L.Class.extend({ - includes: L.Mixin.Events, - +L.LocationFilter = L.Layer.extend({ options: { enableButton: { enableText: "Select area", @@ -100,7 +98,8 @@ L.LocationFilter = L.Class.extend({ }, adjustButton: { text: "Select area within current zoom" - } + }, + buttonPosition: 'topleft' }, initialize: function(options) { @@ -114,7 +113,6 @@ L.LocationFilter = L.Class.extend({ onAdd: function(map) { this._map = map; - this._layer = new L.LayerGroup(); if (this.options.enableButton || this.options.adjustButton) { this._initializeButtonContainer(); @@ -285,6 +283,8 @@ L.LocationFilter = L.Class.extend({ return; } + this._layer = new L.LayerGroup(); + // Calculate filter bounds this._calculateBounds(); @@ -467,7 +467,10 @@ L.LocationFilter = L.Class.extend({ toggles the location filter */ _initializeButtonContainer: function() { var that = this; - this._buttonContainer = new L.Control.ButtonContainer({className: "location-filter button-container"}); + this._buttonContainer = new L.Control.ButtonContainer({ + className: "location-filter button-container", + position: this.options.buttonPosition + }); if (this.options.enableButton) { this._enableButton = new L.Control.Button({