mapbox-plugins-android icon indicating copy to clipboard operation
mapbox-plugins-android copied to clipboard

Implement cancel draggable during onAnnotationDrag

Open Ph0tonic opened this issue 5 years ago • 2 comments

While using this plugin, I needed to cancel a drag event when my point was further apart from another location. The way I solved this was by deleting the point and repainting it so that cancel the drag event. The problem is that it's not efficient at all.

Here is a proposal to allow a drag event to be canceled directly in the dragEventListener. I would be pleased to have your feedback @langsmith and @LukasPaczos.

Thanks in advance

Ph0tonic avatar May 18 '20 15:05 Ph0tonic

Thanks @Ph0tonic, the idea and the implementation look good to me. Would you be able to add a unit test?

@langsmith could you help with merging this when ready?

LukasPaczos avatar May 19 '20 13:05 LukasPaczos

You're welcome. Hum yes I will try to add some test but I not sure any more of my implementation. In the present case when a drag is cancel then the annotation stay still and if we continue our movement then the map moves. I think that this should not happen and could be very strange to the user has he was moving an annotation and suddenly he is moving the map.

What do you think about cancelling the drag but still consuming the event such as to prevent the map to take back the event until the user end is drag ?

Ph0tonic avatar May 19 '20 14:05 Ph0tonic