From a2d2b94cc67d3201c3c69577d0c082bc1b2fa601 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C5=91cze=20Bence?= Date: Sat, 20 Jun 2020 02:14:17 +0200 Subject: [PATCH] MAPG-155 minZoom and maxZoom should depend on zoomOffset --- public/static/js/map_editor.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/public/static/js/map_editor.js b/public/static/js/map_editor.js index a84c06d..10901f2 100644 --- a/public/static/js/map_editor.js +++ b/public/static/js/map_editor.js @@ -334,11 +334,11 @@ var Util = { getHighResData: function () { 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) { - return { ppi: 250, tileSize: 256, zoomOffset: 0 }; + return { ppi: 250, tileSize: 256, zoomOffset: 0, minZoom: 1, maxZoom: 19 }; } 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, tileSize: highResData.tileSize, zoomOffset: highResData.zoomOffset, - minZoom: 2, - maxZoom: 20 + minZoom: highResData.minZoom, + maxZoom: highResData.maxZoom }).addTo(MapEditor.map); MapEditor.map.fitBounds(L.latLngBounds({ lat: mapBounds.south, lng: mapBounds.west }, { lat: mapBounds.north, lng: mapBounds.east }));