Skip to content

Commit

Permalink
ensure pitch events fire with interaction handlers
Browse files Browse the repository at this point in the history
  • Loading branch information
Molly Lloyd committed Mar 28, 2017
1 parent 0b61f4b commit fe9aaf1
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/ui/handler/drag_rotate.js
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,9 @@ class DragRotateHandler {
this._map.moving = true;
this._fireEvent('rotatestart', e);
this._fireEvent('movestart', e);
if (this._pitchWithRotate) {
this._fireEvent('pitchstart', e)
}
}

const map = this._map;
Expand All @@ -119,7 +122,10 @@ class DragRotateHandler {
inertia.push([Date.now(), map._normalizeBearing(bearing, last[1])]);

map.transform.bearing = bearing;
if (this._pitchWithRotate) map.transform.pitch = pitch;
if (this._pitchWithRotate) {
this._fireEvent('pitch', e);
map.transform.pitch = pitch;
}

this._fireEvent('rotate', e);
this._fireEvent('move', e);
Expand Down Expand Up @@ -150,6 +156,7 @@ class DragRotateHandler {
this._map.moving = false;
this._fireEvent('moveend', e);
}
if (this._pitchWithRotate) this._fireEvent('pitchend', e);
};

if (inertia.length < 2) {
Expand Down

0 comments on commit fe9aaf1

Please sign in to comment.