Don't change the visibility of layers with no code
When parsing a layer state ignore any layers with no code attached rather than turning them off - this ensures that the marker layer remains enabled and any markers can be displayed.
This commit is contained in:
parent
53b0ace4c0
commit
ad116b2431
1 changed files with 8 additions and 7 deletions
|
@ -260,15 +260,16 @@ function setMapLayers(layerConfig) {
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
for (var i = 0; i < map.layers.length; i++) {
|
for (var i = 0; i < map.layers.length; i++) {
|
||||||
if (map.layers[i].layerCode &&
|
if (map.layers[i].layerCode) {
|
||||||
layerConfig.indexOf(map.layers[i].layerCode) >= 0) {
|
if (layerConfig.indexOf(map.layers[i].layerCode) >= 0) {
|
||||||
if (map.layers[i].isBaseLayer) {
|
if (map.layers[i].isBaseLayer) {
|
||||||
map.setBaseLayer(map.layers[i]);
|
map.setBaseLayer(map.layers[i]);
|
||||||
|
} else {
|
||||||
|
map.layers[i].setVisibility(true);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
map.layers[i].setVisibility(true);
|
map.layers[i].setVisibility(false);
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
map.layers[i].setVisibility(false);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue