summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
7ac7db3)
Submitted upstream as https://github.com/CloudMade/Leaflet/pull/1169.
this._layers = {};
this._lastZIndex = 0;
this._layers = {};
this._lastZIndex = 0;
+ this._handlingClick = false;
for (var i in baseLayers) {
if (baseLayers.hasOwnProperty(i)) {
for (var i in baseLayers) {
if (baseLayers.hasOwnProperty(i)) {
this._initLayout();
this._update();
this._initLayout();
this._update();
+ map
+ .on('layeradd', this._update, this)
+ .on('layerremove', this._update, this);
+
return this._container;
},
return this._container;
},
+ onRemove: function (map) {
+ map
+ .off('layeradd', this._update)
+ .off('layerremove', this._update);
+ },
+
addBaseLayer: function (layer, name) {
this._addLayer(layer, name);
this._update();
addBaseLayer: function (layer, name) {
this._addLayer(layer, name);
this._update();
},
_update: function () {
},
_update: function () {
- if (!this._container) {
+ if (!this._container || this._handlingClick) {
inputsLen = inputs.length,
baseLayer;
inputsLen = inputs.length,
baseLayer;
+ this._handlingClick = true;
+
for (i = 0; i < inputsLen; i++) {
input = inputs[i];
obj = this._layers[input.layerId];
for (i = 0; i < inputsLen; i++) {
input = inputs[i];
obj = this._layers[input.layerId];
if (baseLayer) {
this._map.fire('baselayerchange', {layer: baseLayer});
}
if (baseLayer) {
this._map.fire('baselayerchange', {layer: baseLayer});
}
+
+ this._handlingClick = false;
},
_expand: function () {
},
_expand: function () {
-}(this));
\ No newline at end of file