Skip to content

Commit

Permalink
don't stop animation on map resize
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewharvey committed Jun 11, 2018
1 parent a3aaa76 commit 9c0c496
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions src/ui/bind_handlers.js
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,10 @@ export default function bindHandlers(map: Map, options: {interactive: boolean})
}

function onWheel(e: WheelEvent) {
if (options.interactive) {
map.stop();
}

const mapEvent = new MapWheelEvent('wheel', map, e);
map.fire(mapEvent);

Expand Down
2 changes: 1 addition & 1 deletion src/ui/map.js
Original file line number Diff line number Diff line change
Expand Up @@ -1735,7 +1735,7 @@ class Map extends Camera {

_onWindowResize() {
if (this._trackResize) {
this.stop().resize()._update();
this.resize()._update();
}
}

Expand Down

0 comments on commit 9c0c496

Please sign in to comment.