]> git.openstreetmap.org Git - rails.git/blobdiff - app/assets/javascripts/leaflet.map.js
Merge remote-tracking branch 'upstream/pull/2161'
[rails.git] / app / assets / javascripts / leaflet.map.js
index ba88e5904dca22cb3c30577ebcf16d25ba95688f..e712a8d1f415719e14746ad6ef279694c5eedc23 100644 (file)
@@ -61,6 +61,12 @@ L.OSM.Map = L.Map.extend({
       code: "G",
       name: I18n.t("javascripts.map.base.gps")
     });
+
+    this.on("layeradd", function (event) {
+      if (this.baseLayers.indexOf(event.layer) >= 0) {
+        this.setMaxZoom(event.layer.options.maxZoom);
+      }
+    });
   },
 
   updateLayers: function(layerParam) {