Skip to content

Commit c1648a0

Browse files
committed
stop map animation on zoomstart, fix #1002
1 parent 635aafc commit c1648a0

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

src/map/Map.Anim.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,9 @@ Map.include(/** @lends Map.prototype */{
165165
},
166166

167167
_animateTo(view, options = {}, step) {
168+
if (this._mapAnimPlayer) {
169+
this._stopAnim(this._mapAnimPlayer);
170+
}
168171
this._isInternalAnimation = true;
169172
this._mapAnimPlayer = this.animateTo(view, options, step);
170173
delete this._isInternalAnimation;

src/map/Map.Zoom.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,9 @@ Map.include(/** @lends Map.prototype */{
5252

5353
onZoomStart(nextZoom, origin) {
5454
if (!this.options['zoomable'] || this.isZooming()) { return; }
55+
if (this._mapAnimPlayer) {
56+
this._stopAnim(this._mapAnimPlayer);
57+
}
5558
this._zooming = true;
5659
this._startZoomVal = this.getZoom();
5760
this._startZoomCoord = this._containerPointToPrj(origin);

0 commit comments

Comments
 (0)