Merged in feature/MAPG-155-adjust-minzoom-and-maxzoom-to-z (pull request #122)
MAPG-155 minZoom and maxZoom should depend on zoomOffset
This commit is contained in:
commit
e612d0d93f
@ -334,11 +334,11 @@
|
|||||||
var Util = {
|
var Util = {
|
||||||
getHighResData: function () {
|
getHighResData: function () {
|
||||||
if (window.devicePixelRatio >= 4) {
|
if (window.devicePixelRatio >= 4) {
|
||||||
return { ppi: 320, tileSize: 128, zoomOffset: 1 };
|
return { ppi: 320, tileSize: 128, zoomOffset: 1, minZoom: 0, maxZoom: 18 };
|
||||||
} else if (window.devicePixelRatio >= 2) {
|
} else if (window.devicePixelRatio >= 2) {
|
||||||
return { ppi: 250, tileSize: 256, zoomOffset: 0 };
|
return { ppi: 250, tileSize: 256, zoomOffset: 0, minZoom: 1, maxZoom: 19 };
|
||||||
} else {
|
} else {
|
||||||
return { ppi: 72, tileSize: 512, zoomOffset: -1 };
|
return { ppi: 72, tileSize: 512, zoomOffset: -1, minZoom: 2, maxZoom: 20 };
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@ -368,8 +368,8 @@
|
|||||||
ppi: highResData.ppi,
|
ppi: highResData.ppi,
|
||||||
tileSize: highResData.tileSize,
|
tileSize: highResData.tileSize,
|
||||||
zoomOffset: highResData.zoomOffset,
|
zoomOffset: highResData.zoomOffset,
|
||||||
minZoom: 2,
|
minZoom: highResData.minZoom,
|
||||||
maxZoom: 20
|
maxZoom: highResData.maxZoom
|
||||||
}).addTo(MapEditor.map);
|
}).addTo(MapEditor.map);
|
||||||
|
|
||||||
MapEditor.map.fitBounds(L.latLngBounds({ lat: mapBounds.south, lng: mapBounds.west }, { lat: mapBounds.north, lng: mapBounds.east }));
|
MapEditor.map.fitBounds(L.latLngBounds({ lat: mapBounds.south, lng: mapBounds.west }, { lat: mapBounds.north, lng: mapBounds.east }));
|
||||||
|
Loading…
Reference in New Issue
Block a user