Limit map to the maximum zoom of the current base layer
Fix maximum zoom levels for various layers and ensure that the map can't be zoomed beyond the limit of the current base layer. Fixes #1978
This commit is contained in:
parent
297b0a0e16
commit
a7cdb0298d
2 changed files with 10 additions and 1 deletions
|
@ -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) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue