Merge pull request #4156 from Leaflet/tile-bounds

Partial revert of e2fbe196, fixes #4145
This commit is contained in:
Vladimir Agafonkin 2016-01-18 15:05:09 +02:00
commit 172668895a

View File

@ -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));
},