Merge pull request #555 from Xelio/patch-event-overlay-add-remove
Status persistence of Layer Chooser: Change to save status on 'overlayadd' and 'overlayremove' events. Instead of checking .overlay everytime a layer is added or removed.
This commit is contained in:
commit
be72f6c1c2
12
code/boot.js
12
code/boot.js
@ -76,14 +76,10 @@ window.setupLayerChooserStatusRecorder = function() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
// Record layerGroups change
|
// Record layerGroups change
|
||||||
window.map.on('layeradd layerremove', function(e) {
|
window.map.on('overlayadd overlayremove', function(e) {
|
||||||
var id = L.stamp(e.layer);
|
var display = (e.type === 'overlayadd');
|
||||||
var layerGroup = this._layers[id];
|
window.updateDisplayedLayerGroup(e.name, display);
|
||||||
if (layerGroup && layerGroup.overlay) {
|
});
|
||||||
var display = (e.type === 'layeradd');
|
|
||||||
window.updateDisplayedLayerGroup(layerGroup.name, display);
|
|
||||||
}
|
|
||||||
}, window.layerChooser);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
window.setupStyles = function() {
|
window.setupStyles = function() {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user