Skip to content

Commit

Permalink
Patch so setPosition works properly on Control.
Browse files Browse the repository at this point in the history
  • Loading branch information
emartinez-usgs committed May 2, 2012
1 parent 58e4f8d commit cfbf317
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/control/Control.js
Expand Up @@ -13,11 +13,16 @@ L.Control = L.Class.extend({
},

setPosition: function (position) {
var map = this._map;

if (map) {
map.removeControl(this);
}

this.options.position = position;

if (this._map) {
this._map.removeControl(this);
this._map.addControl(this);
if (map) {
map.addControl(this);
}
},

Expand Down

0 comments on commit cfbf317

Please sign in to comment.