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:
Tom Hughes 2010-07-21 09:07:38 +01:00
parent 53b0ace4c0
commit ad116b2431

View file

@ -260,8 +260,8 @@ function setMapLayers(layerConfig) {
}
} else {
for (var i = 0; i < map.layers.length; i++) {
if (map.layers[i].layerCode &&
layerConfig.indexOf(map.layers[i].layerCode) >= 0) {
if (map.layers[i].layerCode) {
if (layerConfig.indexOf(map.layers[i].layerCode) >= 0) {
if (map.layers[i].isBaseLayer) {
map.setBaseLayer(map.layers[i]);
} else {
@ -272,6 +272,7 @@ function setMapLayers(layerConfig) {
}
}
}
}
}
function scaleToZoom(scale) {