diff --git a/src/dom/DomUtil.js b/src/dom/DomUtil.js index de6b91f2..a2530803 100644 --- a/src/dom/DomUtil.js +++ b/src/dom/DomUtil.js @@ -141,8 +141,11 @@ L.DomUtil = { point.y + 'px' + (is3d ? ',0)' : ')'); }, - setTransform: function (el, point, scale) { - el.style[L.DomUtil.TRANSFORM] = L.DomUtil.getTranslateString(point) + (scale ? ' scale(' + scale + ')' : ''); + setTransform: function (el, point, scale, oldTransform) { + el.style[L.DomUtil.TRANSFORM] = + (oldTransform ? oldTransform + ' ' : '') + + L.DomUtil.getTranslateString(point) + + (scale ? ' scale(' + scale + ')' : ''); }, getScaleString: function (scale, origin) { diff --git a/src/layer/tile/GridLayer.js b/src/layer/tile/GridLayer.js index d2759318..9be8bbb3 100644 --- a/src/layer/tile/GridLayer.js +++ b/src/layer/tile/GridLayer.js @@ -465,14 +465,17 @@ L.GridLayer = L.Layer.extend({ }, _animateZoom: function (e) { + var oldTransform; + if (!this._animating) { this._animating = true; this._prepareBgBuffer(); + oldTransform = this._bgBuffer.style[L.DomUtil.TRANSFORM]; } var offset = e.delta.add(e.origin.multiplyBy(1 - e.scale)); - L.DomUtil.setTransform(this._bgBuffer, offset, e.scale); + L.DomUtil.setTransform(this._bgBuffer, offset, e.scale, oldTransform); }, _endZoomAnim: function () {