round grid layer scaling transform

This commit is contained in:
Vladimir Agafonkin 2014-01-16 01:47:59 +02:00
parent e41d65fe66
commit c1b2c5c37c

View File

@ -218,7 +218,7 @@ L.GridLayer = L.Layer.extend({
this._pxOrigin = map._getNewTopLeftPoint(center, this._tileZoom); this._pxOrigin = map._getNewTopLeftPoint(center, this._tileZoom);
this._origScale = map.getZoomScale(zoom) / map.getZoomScale(this._tileZoom); this._origScale = map.getZoomScale(zoom) / map.getZoomScale(this._tileZoom);
this._origTranslate = map.getSize().multiplyBy((1 - this._origScale) / 2, true) this._origTranslate = map.getSize().multiplyBy((1 - this._origScale) / 2, true)
.subtract(map._getMapPanePos()); .subtract(map._getMapPanePos()).round();
L.DomUtil.setTransform(this._tileContainer, this._origTranslate, this._origScale); L.DomUtil.setTransform(this._tileContainer, this._origTranslate, this._origScale);