]> git.openstreetmap.org Git - rails.git/commitdiff
Stop default layer flickering when notes or data are shown
authorTom Hughes <tom@compton.nu>
Fri, 13 Sep 2013 15:07:51 +0000 (16:07 +0100)
committerTom Hughes <tom@compton.nu>
Fri, 13 Sep 2013 15:07:51 +0000 (16:07 +0100)
app/assets/javascripts/index.js

index 95771a4b2ae4645416ac0e26bcfb3f9e229330c5..5f6a4efb729b15690b5f6971126e924b82d081c6 100644 (file)
@@ -59,14 +59,12 @@ $(document).ready(function () {
       if (layerParam.indexOf(layers[i].options.code) >= 0) {
         map.addLayer(layers[i]);
         layersAdded = layersAdded + layers[i].options.code;
+      } else if (i == 0 && layersAdded == "") {
+        map.addLayer(layers[i]);
       } else {
         map.removeLayer(layers[i]);
       }
     }
-
-    if (layersAdded == "") {
-      map.addLayer(layers[0]);
-    }
   }
 
   updateLayers(params);