}
});
-L.LocationFilter = L.Class.extend({
- includes: L.Mixin.Events,
-
+L.LocationFilter = L.Layer.extend({
options: {
enableButton: {
enableText: "Select area",
},
adjustButton: {
text: "Select area within current zoom"
- }
+ },
+ buttonPosition: 'topleft'
},
initialize: function(options) {
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();
this._eastRect = this._drawRectangle(this._eastBounds);
this._southRect = this._drawRectangle(this._southBounds);
this._innerRect = this._drawRectangle(this.getBounds(), {
- fillColor: "transparent",
+ fillOpacity: 0,
stroke: true,
color: "white",
weight: 1,
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({