X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/e1f37fcc84983cd588ac8460b999355ca3efc343..f906373be251d79988335e96e8046c7f001c613b:/app/assets/javascripts/leaflet.map.js?ds=sidebyside diff --git a/app/assets/javascripts/leaflet.map.js b/app/assets/javascripts/leaflet.map.js index ba88e5904..e712a8d1f 100644 --- a/app/assets/javascripts/leaflet.map.js +++ b/app/assets/javascripts/leaflet.map.js @@ -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) {