Skip to content

Commit

Permalink
Fix issue where browsers could page back or forward when swiping hori…
Browse files Browse the repository at this point in the history
…zontally over the map with a trackpad (close openstreetmap#5552)
  • Loading branch information
quincylvania authored and zlavergne committed Mar 10, 2020
1 parent ecf8a9e commit e85e790
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions modules/renderer/map.js
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,10 @@ export function rendererMap(context) {
});

selection
.on('wheel.map mousewheel.map', function() {
// disable swipe-to-navigate browser pages on trackpad/magic mouse – #5552
d3_event.preventDefault();
})
.call(_zoomerPanner)
.call(_zoomerPanner.transform, projection.transform())
.on('dblclick.zoom', null); // override d3-zoom dblclick handling
Expand Down

0 comments on commit e85e790

Please sign in to comment.