Non puoi selezionare più di 25 argomenti
Gli argomenti devono iniziare con una lettera o un numero, possono includere trattini ('-') e possono essere lunghi fino a 35 caratteri.
37 righe
814 B
37 righe
814 B
2 anni fa
|
(function() {
|
||
|
|
||
|
L.Control.Loader = L.Control.extend({
|
||
|
onAdd: function(map) {
|
||
|
this._map = map;
|
||
|
this._container = L.DomUtil.create('div','leaflet-control-loader');
|
||
|
this.hide();
|
||
|
return this._container;
|
||
|
},
|
||
|
addTo: function (map) {
|
||
|
this._container = this.onAdd(map);
|
||
|
map.getContainer().appendChild(this._container);
|
||
|
return this;
|
||
|
},
|
||
|
show: function() {
|
||
|
this._container.style.display = 'block';
|
||
|
return this;
|
||
|
},
|
||
|
hide: function() {
|
||
|
this._container.style.display = 'none';
|
||
|
return this;
|
||
|
}
|
||
|
});
|
||
|
|
||
|
L.Map.addInitHook(function () {
|
||
|
if (this.options.loaderControl) {
|
||
|
this.loaderControl = L.control.loader(this.options.loaderControl);
|
||
|
this.addControl(this.loaderControl);
|
||
|
}
|
||
|
});
|
||
|
|
||
|
L.control.loader = function (options) {
|
||
|
return new L.Control.Loader(options);
|
||
|
};
|
||
|
|
||
|
}).call(this);
|