Skip to content

Commit

Permalink
stop map animation on zoomstart, fix #1002
Browse files Browse the repository at this point in the history
  • Loading branch information
fuzhenn committed Sep 17, 2019
1 parent 635aafc commit c1648a0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/map/Map.Anim.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
3 changes: 3 additions & 0 deletions src/map/Map.Zoom.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit c1648a0

Please sign in to comment.