From c1648a0a2f859d4c22d7a49fca8412041b7e3e99 Mon Sep 17 00:00:00 2001 From: fuzhenn Date: Tue, 17 Sep 2019 11:23:16 +0800 Subject: [PATCH] stop map animation on zoomstart, fix #1002 --- src/map/Map.Anim.js | 3 +++ src/map/Map.Zoom.js | 3 +++ 2 files changed, 6 insertions(+) diff --git a/src/map/Map.Anim.js b/src/map/Map.Anim.js index 9546dd630..7c8986a07 100644 --- a/src/map/Map.Anim.js +++ b/src/map/Map.Anim.js @@ -165,6 +165,9 @@ Map.include(/** @lends Map.prototype */{ }, _animateTo(view, options = {}, step) { + if (this._mapAnimPlayer) { + this._stopAnim(this._mapAnimPlayer); + } this._isInternalAnimation = true; this._mapAnimPlayer = this.animateTo(view, options, step); delete this._isInternalAnimation; diff --git a/src/map/Map.Zoom.js b/src/map/Map.Zoom.js index f40ad54ad..cf331f57a 100644 --- a/src/map/Map.Zoom.js +++ b/src/map/Map.Zoom.js @@ -52,6 +52,9 @@ Map.include(/** @lends Map.prototype */{ onZoomStart(nextZoom, origin) { if (!this.options['zoomable'] || this.isZooming()) { return; } + if (this._mapAnimPlayer) { + this._stopAnim(this._mapAnimPlayer); + } this._zooming = true; this._startZoomVal = this.getZoom(); this._startZoomCoord = this._containerPointToPrj(origin);