]> git.openstreetmap.org Git - rails.git/blobdiff - app/assets/javascripts/leaflet.map.js.erb
Stop query button disabling query mode once it is active
[rails.git] / app / assets / javascripts / leaflet.map.js.erb
index 1171390aa32904f3322d783a1d8205740ea65ebc..496e2985859df30fc2d4811bb3c22aa5d457a55b 100644 (file)
@@ -91,7 +91,7 @@ L.OSM.Map = L.Map.extend({
   },
 
   getUrl: function(marker) {
-    var precision = zoomPrecision(this.getZoom()),
+    var precision = OSM.zoomPrecision(this.getZoom()),
         params = {};
 
     if (marker && this.hasLayer(marker)) {
@@ -148,6 +148,11 @@ L.OSM.Map = L.Map.extend({
     }
 
     var params = {};
+    var layers = this.getLayersCode().replace('M', '');
+
+    if (layers) {
+      params.layers = layers;
+    }
 
     if (marker && this.hasLayer(marker)) {
       params.m = '';
@@ -236,7 +241,7 @@ L.OSM.Map = L.Map.extend({
 
   setState: function(state, options) {
     if (state.center) this.setView(state.center, state.zoom, options);
-    this.updateLayers(state.layers);
+    if (state.layers) this.updateLayers(state.layers);
   }
 });