From db5dbe26d8bb9e247870df2792ae28dd936e356d Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Mon, 2 Feb 2015 10:53:23 +0100 Subject: viewer: allow zooming in by one step --- viewer/MinedMap.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/viewer/MinedMap.js b/viewer/MinedMap.js index 577421b..d566fff 100644 --- a/viewer/MinedMap.js +++ b/viewer/MinedMap.js @@ -35,7 +35,12 @@ var MinedMapLayer = L.GridLayer.extend({ }, _getTileSize: function () { - return 512; + var map = this._map, zoom = map.getZoom(); + + if (zoom > 0) + return Math.round(map.getZoomScale(map.getZoom(), 0) * 512); + else + return 512; }, _onTileRemove: function (e) { @@ -69,7 +74,7 @@ window.createMap = function () { center: [0, 0], zoom: 0, minZoom: 0, - maxZoom: 0, + maxZoom: 1, crs: L.CRS.Simple, maxBounds: [ [-512*(info.info.maxZ+1), 512*info.info.minX], -- cgit v1.2.3