-
Notifications
You must be signed in to change notification settings - Fork 2.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support dragPan.disable() mid-drag #2419
Comments
What are your thoughts, @bhousel? |
The reason for wanting/needing to use On desktop, you can |
I identified more limitations (#2237) in the current interactions implementation a while back that probably, along with this, should be adressed in a broader re-design of how interactions are enabled/disabled and how interactions that depend on the state of others get such information... |
^ yes, this |
Being able to disable interactions better would be nice. We are stepping around this in a few places with Draw currently. Mostly with zoom on double click. |
@bhousel I'd love to see a clean-slate reimagining of our interaction handlers, when you have some spare cycles 😄 |
I got this error when app is in background and i am trying to open the app again ,i search a lot and get solution to disable map ,i tried this mapView.setEnabled(false); but unfortunately that's not working Anyone can help me to resolve this issue: E/AndroidRuntime: FATAL EXCEPTION: main |
+1 I'm running into the same exact issue as @kristfal (disabling dragPan mid-drag for mobile/touch devices). It is a crucial functionality for my app. |
Allows draggable markers to work on mobile (touch) devices.
Allows the user to call map.dragPan.disable() mid-drag. This enables draggable markers on mobile devices.
I've created a pull request that fixes this issue. |
Really need this feature ! #5486 |
@clemishow Agreed, this PR has been dead for a while! Can we get an owner to look at it again and help us get it accepted? |
@krabbypattified Yeah, and in addition it works perfectly |
This solved my problem.
|
mapbox-gl-js version: Master branch
Steps to Trigger Behavior
map.dragPan.disable()
during the drag eventExpected Behavior
Dragging should no longer move the map.
Actual Behavior
Map will continue being draggable until
mouseup
ortouchend
Afaik, the root issue is that event listeners can't be removed until the ongoing
mousedown
/touchstart
event is finished.Workaround:
Update the following drag_pan.js handlers:
The text was updated successfully, but these errors were encountered: