update several plugins to use window.addLayerGroup, instead of manually adding the layer to the map and Layer control.

this gives automatic handling of remembering shown/hidden layers

also, draw tools plugin hides the controls while the drawn items layer is hidden
This commit is contained in:
Jon Atkins
2013-05-18 03:42:56 +01:00
parent 2f482bf4a4
commit 6e8dd15052
4 changed files with 24 additions and 9 deletions

View File

@ -116,7 +116,7 @@ window.plugin.maxLinks.setup = function() {
window.plugin.maxLinks.updateLayer();
});
window.map.on('zoomend moveend', window.plugin.maxLinks.updateLayer);
window.layerChooser.addOverlay(window.plugin.maxLinks.layer, 'Maximum Links');
window.addLayerGroup('Maximum Links', window.plugin.maxLinks.layer);
}
var setup = window.plugin.maxLinks.setup;