Permalink
Browse files

Merge pull request #16 from mjakob/topic/button-position

Added a buttonPosition option to the LocationFilter class
  • Loading branch information...
2 parents 0019537 + 1e51f12 commit fd3a095b2a589a1b488376d5c63c6dcd42757f10 @kajic committed Apr 9, 2014
Showing with 8 additions and 2 deletions.
  1. +2 −0 README.md
  2. +6 −2 src/locationfilter.js
View
@@ -54,6 +54,8 @@ var isEnabled = locationFilter.isEnabled();
**enable** (optional): Set to true to enable the filter as soon as it is added to the map. Defaults to false.
+**buttonPosition**: Set to position the associated buttons on the map. Defaults to 'topleft'.
+
#### Events
**change**: Fired when the location filter changes size or position.
@@ -100,7 +100,8 @@ L.LocationFilter = L.Class.extend({
},
adjustButton: {
text: "Select area within current zoom"
- }
+ },
+ buttonPosition: 'topleft'
},
initialize: function(options) {
@@ -468,7 +469,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({

0 comments on commit fd3a095

Please sign in to comment.