Fix issue where browsers could page back or forward when swiping horizontally over the map with a trackpad (close #5552)

This commit is contained in:
Quincy Morgan
2020-03-10 11:15:15 -07:00
parent 8dcb50579f
commit 73d68b7a65

View File

@@ -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