mirror of
https://github.com/webbukkit/dynmap.git
synced 2024-12-28 03:27:36 +01:00
Update zoom range to match selected map
This commit is contained in:
parent
4622b42aed
commit
4824388c6b
@ -319,6 +319,11 @@ DynMap.prototype = {
|
||||
me.world = mapWorld;
|
||||
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) {
|
||||
var centerPoint;
|
||||
@ -329,11 +334,11 @@ DynMap.prototype = {
|
||||
else {
|
||||
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) {
|
||||
$(me).trigger('worldchanged');
|
||||
|
Loading…
Reference in New Issue
Block a user