Skip to content
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

Disable long press gesture on map #2215

Open
feelingsonice opened this issue Jul 24, 2024 · 5 comments
Open

Disable long press gesture on map #2215

feelingsonice opened this issue Jul 24, 2024 · 5 comments
Labels
feature 🍏 When working on a new feature or feature enhancement

Comments

@feelingsonice
Copy link

New Feature

There's no way to disable long press gestures on a map. And a long press gesture is not apart of the set of gestures you can control

Why

This is intrusive because once a long press gesture registers, it pauses all the other gestures. The user should be able to control this behavior.

@persidskiy
Copy link
Contributor

persidskiy commented Jul 24, 2024

Hi @feelingsonice, thank you for the report.

Can you please clarify what's your use, and what code you have?

@feelingsonice
Copy link
Author

@persidskiy The long press gesture is intrusive. Once it registers, it disables other gestures until it’s released. More specifically, I need to implement my own gesture on a MapViewAnnoyation but it takes precedence over my implementation and I can’t override it. I’m sure having a gesture you can’t disable isn’t ideal.

@feelingsonice
Copy link
Author

feelingsonice commented Jul 28, 2024

Hi @persidskiy, upon further investigation, I realize that the long press gesture isn't the only gesture that can't be turned off? i.e. If my viewport is in FollowPuckViewportState and I set map gesture options to false:

GestureOptions(
            panEnabled: false,
            pinchEnabled: false,
            rotateEnabled: false,
            simultaneousRotateAndPinchZoomEnabled: false,
            pinchZoomEnabled: false,
            pinchPanEnabled: false,
            pitchEnabled: false,
            doubleTapToZoomInEnabled: false,
            doubleTouchToZoomOutEnabled: false,
            quickZoomEnabled: false
        )

touching the map still takes me out of the FollowPuckViewportState into idle? Is there way to prevent this? Basically a way to completely disable user input?

@persidskiy
Copy link
Contributor

@feelingsonice Thank you for providing more information. Can you also specify which actual use-case you are trying to solve? Potentially, we can use it for testing.

Internal issue: https://mapbox.atlassian.net/browse/MAPSIOS-1520

@persidskiy persidskiy added the feature 🍏 When working on a new feature or feature enhancement label Aug 1, 2024
@feelingsonice
Copy link
Author

feelingsonice commented Aug 22, 2024

Hey @persidskiy, sorry I missed your message. The intuition for what I'm trying is solve is something like this:

On some occasions, I want to fix the map view and completely disable user gesture on the map so that the user can't pan/rotate/pinch away from it. An imaginary scenario would be when the user is looking at an annotation on the map and needs to explicitly dismiss something first. In this case, without disabling the map gestures, the user can simply pan away.

Does this make sense? I could elaborate further if that's helpful. Not sure if others have ever requested a feature like this but it's extremely important for me. I appreciate the help here :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature 🍏 When working on a new feature or feature enhancement
Projects
None yet
Development

No branches or pull requests

2 participants