mapbox / mapbox-maps-android

Interactive, thoroughly customizable maps in native Android powered by vector tiles and OpenGL.
https://www.mapbox.com/mobile-maps-sdk
Other
466 stars 131 forks source link

Annotation drag is too sensitive; triggers on marker clicks #1528

Closed akirmse closed 2 years ago

akirmse commented 2 years ago

Environment

I have both a OnPointAnnotationClickListener and a OnPointAnnotationDragListener. I observe that nearly every time I touch a marker (a point annotation), I get 3 events in this order:

I think it's undesirable to have a drag triggered before nearly every click. It certainly messes up my app's logic. Perhaps the drag threshold is too low? I don't see this behavior on the Mapbox iOS SDK.

akirmse commented 2 years ago

More seriously, I get drag events even if the annotation has its draggable property set to false:

https://github.com/mapbox/mapbox-maps-android/blob/a35ee8cc52b7980f2b0d8a4808f71b96a6e4304f/plugin-annotation/src/main/java/com/mapbox/maps/plugin/annotation/generated/PointAnnotationOptions.kt#L637

ZiZasaurus commented 2 years ago

@akirmse thank you for reporting. The team will look into what could be causing this behavior.

Chaoba commented 2 years ago

@akirmse We listen to the events from AndroidGesturesManager and it does fire onMoveBegin and then onSingleTapConfirmed events when clicking.

More seriously, I get drag events even if the annotation has its draggable property set to false:

This is a bug and will be fixed.

Chaoba commented 2 years ago

Fixed in https://github.com/mapbox/mapbox-maps-android/pull/1552. Feel free to reopen this issue if you have other questions about this.