Skip to content

Commit

Permalink
fix map.isMoving for drag-pan/rotate
Browse files Browse the repository at this point in the history
  • Loading branch information
mourner committed Mar 1, 2017
1 parent d0ff12f commit edd46a3
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/ui/handler/drag_pan.js
Expand Up @@ -95,6 +95,7 @@ class DragPanHandler {

if (!this.isActive()) {
this._active = true;
this._map.moving = true;
this._fireEvent('dragstart', e);
this._fireEvent('movestart', e);
}
Expand Down Expand Up @@ -123,7 +124,10 @@ class DragPanHandler {
this._fireEvent('dragend', e);
this._drainInertiaBuffer();

const finish = () => this._fireEvent('moveend', e);
const finish = () => {
this._map.moving = false;
this._fireEvent('moveend', e);
};

const inertia = this._inertia;
if (inertia.length < 2) {
Expand Down
2 changes: 2 additions & 0 deletions src/ui/handler/drag_rotate.js
Expand Up @@ -96,6 +96,7 @@ class DragRotateHandler {

if (!this.isActive()) {
this._active = true;
this._map.moving = true;
this._fireEvent('rotatestart', e);
this._fireEvent('movestart', e);
}
Expand Down Expand Up @@ -143,6 +144,7 @@ class DragRotateHandler {
if (Math.abs(mapBearing) < this._bearingSnap) {
map.resetNorth({noMoveStart: true}, { originalEvent: e });
} else {
this._map.moving = false;
this._fireEvent('moveend', e);
}
};
Expand Down

0 comments on commit edd46a3

Please sign in to comment.