Add control for hide/show of component layers (only regions for now)
This commit is contained in:
parent
af3301c22b
commit
5bacbfe42b
3 changed files with 15 additions and 1 deletions
|
|
@ -165,6 +165,7 @@ componentconstructors['regions'] = function(dynmap, configuration) {
|
|||
var activeLayer = undefined;
|
||||
function undraw() {
|
||||
if (activeLayer) {
|
||||
dynmap.layercontrol.removeLayer(activeLayer);
|
||||
dynmap.map.removeLayer(activeLayer);
|
||||
activeLayer = undefined;
|
||||
}
|
||||
|
|
@ -183,6 +184,7 @@ componentconstructors['regions'] = function(dynmap, configuration) {
|
|||
result: function(regionsLayer) {
|
||||
activeLayer = regionsLayer;
|
||||
dynmap.map.addLayer(activeLayer);
|
||||
dynmap.layercontrol.addOverlay(activeLayer, regionType);
|
||||
}
|
||||
}));
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue