X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/e1f37fcc84983cd588ac8460b999355ca3efc343..083500f056f5b995f1979f88b37793046d9e4d37:/app/assets/javascripts/leaflet.map.js 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) {