React-map-gl: How to disable double tap zoom and scroll zoom?

Created on 9 Apr 2020  路  2Comments  路  Source: visgl/react-map-gl

Hi, i want the map to be zoom in only on clicking the marker apart from that. Map shouldn't zoom on double tap, Mousescroll etc... How to do this.. Any idea?

Most helpful comment

try this:

const [settings, setsettings] = useState({
dragPan: false,
dragRotate: false,
scrollZoom: false,
touchZoom: false,
touchRotate: false,
keyboard: false,
doubleClickZoom: false
});

{...viewPort}
{...settings} ...

All 2 comments

you can disable scroll zoom using scrollZoom
doubleClickZoom for double click zoom
you can find more example here:
https://uber.github.io/react-map-gl/examples/interaction

try this:

const [settings, setsettings] = useState({
dragPan: false,
dragRotate: false,
scrollZoom: false,
touchZoom: false,
touchRotate: false,
keyboard: false,
doubleClickZoom: false
});

{...viewPort}
{...settings} ...

Was this page helpful?
0 / 5 - 0 ratings

Related issues

cjmyles picture cjmyles  路  3Comments

Majaspic picture Majaspic  路  4Comments

huaying picture huaying  路  5Comments

bogdancaspar picture bogdancaspar  路  3Comments

nip10 picture nip10  路  4Comments