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

@ -77,8 +77,7 @@ var setup = function() {
}")
.appendTo("head");
window.layerChooser.addOverlay(window.plugin.portalLevelNumbers.levelLayerGroup, 'Portal Levels');
map.addLayer(window.plugin.portalLevelNumbers.levelLayerGroup);
window.addLayerGroup('Portal Levels', window.plugin.portalLevelNumbers.levelLayerGroup, true);
window.addHook('portalAdded', window.plugin.portalLevelNumbers.portalAdded);
}