Skip to content

Android longPress to initiate PointAnnotation draggable - #4267

Open
lochstar wants to merge 2 commits into
rnmapbox:mainfrom
lochstar:android-longpress-draggable-pointannotation
Open

Android longPress to initiate PointAnnotation draggable#4267
lochstar wants to merge 2 commits into
rnmapbox:mainfrom
lochstar:android-longpress-draggable-pointannotation

Conversation

@lochstar

Copy link
Copy Markdown

Description

This change is based on an old discussion at #3425.

When multiple draggable PointAnnotation are visible on a pan-able map, it is very easy to accidentally trigger the drag event of the PointAnnotation whilst moving around the map.

This issue only exists on Android, iOS already implements a long-press to start the drag. This PR aligns the behaviour.

How to verify

Example App > Show Point Annotation: tap selects, longPress then drag fires onDrag.


Whilst testing in the example app, I noticed there is a crash when pressing "Render Polygon above", I've added asStringOrNull check to both setAboveLayerID and setBelow. Let me know if you want me to add the same to any of the other functions, e.g. setSourceLayerID.

Checklist

  • I've read CONTRIBUTING.md
  • I updated the doc/other generated code with running yarn generate in the root folder
  • I have tested the new feature on /example app.
    • In V11 mode/ios
    • In New Architecture mode/ios
    • In V11 mode/android
    • In New Architecture mode/android
  • I added/updated a sample - if a new feature was implemented (/example)

@lochstar
lochstar requested a deployment to CI with Mapbox Tokens July 30, 2026 00:59 — with GitHub Actions Waiting
@lochstar
lochstar requested a deployment to CI with Mapbox Tokens July 30, 2026 00:59 — with GitHub Actions Waiting
@lochstar
lochstar requested a deployment to CI with Mapbox Tokens July 30, 2026 00:59 — with GitHub Actions Waiting
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant