]> git.openstreetmap.org Git - rails.git/commitdiff
Make sure unused layers are hidden
authorTom Hughes <tom@compton.nu>
Sat, 21 May 2011 09:44:52 +0000 (10:44 +0100)
committerTom Hughes <tom@compton.nu>
Sat, 21 May 2011 09:44:52 +0000 (10:44 +0100)
When parsing an old style layer configuration string, make sure any
layer which isn't active is marked as invisible so that we don't
include it when generating permalinks. Fixes #3773.

public/javascripts/map.js

index 66ed9e909492ca0efc6c3950cf64f617aa5d5c0c..58950a1ffa14b724e3a8296d3b3b2c89e3a52ae5 100644 (file)
@@ -251,6 +251,8 @@ function setMapLayers(layerConfig) {
 
          if (c == "B") {
             map.setBaseLayer(layers[i]);
 
          if (c == "B") {
             map.setBaseLayer(layers[i]);
+         } else {
+            map.layers[i].setVisibility(false);
          }
       }
    } else {
          }
       }
    } else {
@@ -260,7 +262,7 @@ function setMapLayers(layerConfig) {
                if (map.layers[i].isBaseLayer) {
                   map.setBaseLayer(map.layers[i]);
                } else {
                if (map.layers[i].isBaseLayer) {
                   map.setBaseLayer(map.layers[i]);
                } else {
-                   map.layers[i].setVisibility(true);
+                  map.layers[i].setVisibility(true);
                }
             } else {
                map.layers[i].setVisibility(false);
                }
             } else {
                map.layers[i].setVisibility(false);