mapbox / mapbox-gl-js

Interactive, thoroughly customizable maps in the browser, powered by vector tiles and WebGL
https://docs.mapbox.com/mapbox-gl-js/
Other
11.23k stars 2.23k forks source link

v1.10.0-beta.1 - No way to disable new "tap then drag" to zoom gesture #9584

Open jwoodwardtfx opened 4 years ago

jwoodwardtfx commented 4 years ago

The TouchZoomRotateHandler support various gestures ("zoom rotate", "pinch zoom/touch zoom", "single finger zoom/tap then drag"), however it only allows you to disable the "zoom rotate" gesture.

The individual gestures can be disabled by diving in to the private members (such as by calling "map.touchZoomRotate._tapDragZoom.disable();").

It would be nicer to have a match for disableRotation()/enableRotation() to turn on/off each supported gesture (i.e. add a disableTapZoom()/enableTapZoom()).

jaybo commented 8 months ago

I've been using mapbox-gl-draw and have been fighting the issue of sometimes while dragging a vertex or point, the map suddenly begins to zoom. First I thought it was a bug in my code, then a bug in a Draw, and now, I'm finally discovering (seriously after YEARS) of futzing with this, that it's a mapbox-gl "feature". The current state of affairs is bogus when using Draw on touch devices, since I can't selectively disable just single finger tap zoom without resetting private members every time the control is enabled/disabled.

Everyone using Draw will want this disabled by default.