Leaflet/src/control/Control.js
2012-02-14 11:42:01 +02:00

25 lines
403 B
JavaScript

L.Control = L.Class.extend({
options: {
position: 'topright'
},
initialize: function (options) {
L.Util.setOptions(this, options);
},
getPosition: function () {
return this.options.position;
},
setPosition: function (position) {
this.options.position = position;
if (this._map) {
this._map.removeControl(this);
this._map.addControl(this);
}
}
});