Merge pull request #657 from ericmmartinez/master

Patch for L.Control#setPosition
This commit is contained in:
Vladimir Agafonkin 2012-05-03 07:55:53 -07:00
commit 0bd0c1a95a

View File

@ -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);
}
},