From ad116b243127bc37ea51d765c577de050b5ad33a Mon Sep 17 00:00:00 2001 From: Tom Hughes Date: Wed, 21 Jul 2010 09:07:38 +0100 Subject: [PATCH] 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. --- public/javascripts/map.js | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/public/javascripts/map.js b/public/javascripts/map.js index 6fcfdf120..272913d20 100644 --- a/public/javascripts/map.js +++ b/public/javascripts/map.js @@ -260,15 +260,16 @@ 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].isBaseLayer) { - map.setBaseLayer(map.layers[i]); + if (map.layers[i].layerCode) { + if (layerConfig.indexOf(map.layers[i].layerCode) >= 0) { + if (map.layers[i].isBaseLayer) { + map.setBaseLayer(map.layers[i]); + } else { + map.layers[i].setVisibility(true); + } } else { - map.layers[i].setVisibility(true); + map.layers[i].setVisibility(false); } - } else { - map.layers[i].setVisibility(false); } } } -- 2.43.2