maps icon indicating copy to clipboard operation
maps copied to clipboard

Implement a Draggable Prop in any Point Layer

Open SethTyemill opened this issue 7 years ago • 7 comments

Issue: I am unable to find any point object from the Mapbox library in which you are able to implement a dragging function. I am currently attempting to place points on the map and have the user be able to drag the point to a new location within the map view.

This function is vital to a lot of users and I was wondering if there is any way to implement this within this library. I have checked ShapeSource, PointAnnotation, SymbolLayer, CircleLayer, and have come up with nothing. I know other users have more than likely attempted to implement this and if there are other existing issues relating to this, I would love to read them.

Expected Behavior: https://developers.google.com/maps/documentation/javascript/markers#draggable

SethTyemill avatar Aug 13 '19 00:08 SethTyemill

Totally essential, I haven't tried this , but isn't it possible to change coordinate of one pointer using gesture system ?

Ashkan-Oliaie avatar Aug 13 '19 04:08 Ashkan-Oliaie

FWIW ios has dragable annotation views: android has dragable markers

mfazekas avatar Aug 13 '19 08:08 mfazekas

I'm also interested in this feature. And if someone of the maintainers can outline a vision of how this feature fits this library, I can try to implement it.

What I see now is that on iOS this has to be implemented using PointAnnotation, and readme says that it's "deprecated and buggy, use SymbolLayer instead".

doomsower avatar Aug 17 '19 11:08 doomsower

@doomsower PointAnnotation is deprecated as it's currently broken on android. I guess if it's fixed it can be usefull in mapbox. For some usecase SymbolLayer is a replacement and much better for some it's not.

For example If you need to display a lot of icons and titles on the map use SymbolLayer it's much faster and better. If you want to display a single native view at a specific point use PointAnnotation, SymbolLayer is not a replacement.

I guess any solution is acceptable to rnmbgl. Ideally it has to work on both ios and android.

mfazekas avatar Aug 17 '19 15:08 mfazekas

@mfazekas Do you know what the best way to fix PointAnnotation is for Android? It looks like the annotations were moved to a plugin: https://docs.mapbox.com/android/plugins/overview/annotation/

Is that something we could add to this library?

frankrowe avatar Aug 26 '19 13:08 frankrowe

@frankrowe sure we can add annotation plugin.

mfazekas avatar Aug 26 '19 19:08 mfazekas

@SethTyemill PointAnnotation has been updated and now has a draggable prop and events.

frankrowe avatar Sep 19 '19 17:09 frankrowe