From db016b7a30e6c05950aed0766ee9d1bb763ca540 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Iv=C3=A1n=20S=C3=A1nchez=20Ortega?= Date: Mon, 18 Jan 2016 10:58:52 +0100 Subject: [PATCH] Partial revert of e2fbe196, fixes #4145 --- src/layer/tile/GridLayer.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/layer/tile/GridLayer.js b/src/layer/tile/GridLayer.js index 1707eab5..c4b62136 100644 --- a/src/layer/tile/GridLayer.js +++ b/src/layer/tile/GridLayer.js @@ -444,8 +444,9 @@ L.GridLayer = L.Layer.extend({ _getTiledPixelBounds: function (center) { var map = this._map, + scale = map.getZoomScale(map.getZoom(), this._tileZoom), pixelCenter = map.project(center, this._tileZoom).floor(), - halfSize = map.getSize().divideBy(2); + halfSize = map.getSize().divideBy(scale * 2); return new L.Bounds(pixelCenter.subtract(halfSize), pixelCenter.add(halfSize)); },