Update zoom range to match selected map
This commit is contained in:
parent
d7e3593529
commit
67da71b520
1 changed files with 9 additions and 4 deletions
|
|
@ -319,6 +319,11 @@ DynMap.prototype = {
|
||||||
me.world = mapWorld;
|
me.world = mapWorld;
|
||||||
me.maptype = map;
|
me.maptype = map;
|
||||||
|
|
||||||
|
me.map.addLayer(me.maptype);
|
||||||
|
if(me.maptype.options.maxZoom < prevzoom)
|
||||||
|
prevzoom = me.maptype.options.maxZoom;
|
||||||
|
me.map.options.maxZoom = me.maptype.options.maxZoom;
|
||||||
|
me.map.options.minZoom = me.maptype.options.minZoom;
|
||||||
|
|
||||||
if (projectionChanged || worldChanged) {
|
if (projectionChanged || worldChanged) {
|
||||||
var centerPoint;
|
var centerPoint;
|
||||||
|
|
@ -329,11 +334,11 @@ DynMap.prototype = {
|
||||||
else {
|
else {
|
||||||
centerPoint = me.map.getCenter();
|
centerPoint = me.map.getCenter();
|
||||||
}
|
}
|
||||||
me.map.setView(centerPoint, 0, true);
|
me.map.setView(centerPoint, prevzoom, true);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
me.map.setZoom(prevzoom);
|
||||||
}
|
}
|
||||||
me.map.addLayer(me.maptype);
|
|
||||||
|
|
||||||
me.map.setZoom(prevzoom);
|
|
||||||
|
|
||||||
if (worldChanged) {
|
if (worldChanged) {
|
||||||
$(me).trigger('worldchanged');
|
$(me).trigger('worldchanged');
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue