mapbox-maps-ios
mapbox-maps-ios copied to clipboard
isDraggable for Point Annotation in v10
New Feature
Draggable annotations. In the existing production versions of Mapbox (6.3.0) there is isDraggable on an MGLAnnotationView. It would be great to have the same applied to PointAnnotation. I did see it around Beta 16, but it subsequently disappeared.
Why
The features allow a user to select a specific location on a map in an intuitive way.
I've implemented (https://github.com/landyrev/mapbox-maps-ios/pull/1) proof-of-concept for annotation isDraggable property in my own iOS SDK fork (here is demo), but I had to modify generated code for Point Annotation Manager
So, to finish this and make a PR to Mapbox iOS SDK I need documentation on how to modify Annotation Managers and generate code for them (see https://github.com/mapbox/mapbox-maps-ios/issues/550)
cc @nishant-karajgikar
I'll add that annotations can be dragged in the Mapbox Android SDK. It would be very nice to have parity (my app requires it).
https://docs.mapbox.com/android/maps/api/10.0.0-rc.7/-mapbox%20-maps%20-android/com.mapbox.maps.plugin.annotation.generated/-on-point-annotation-drag-listener/
FYI, I have posted an alternative solution in https://github.com/mapbox/mapbox-maps-ios/issues/829#issuecomment-968055970, which doesn't require modifying the core MapboxMaps project. It's based on @landyrev's excellent example.
Thanks @samcrawford for the example. I'm working off of your example for my own use case. Great work. 💯
I'm wondering if there's any official progress from Mapbox @macdrevx ?
Draggable Point Annotations were introduced in v10.10.0 of the SDK, (specifically in this PR). 🎉
More information in the API reference here.
Closing this out as complete.
Draggable Point Annotations were introduced in v10.10.0 of the SDK, (specifically in this PR). 🎉
More information in the API reference here.
Closing this out as complete.
It's good update but we can use it if there is feedback of which annotation was moved to which point . maybe a delegate / notification would help .
The current draggable implementation added in 10.10.0 is a welcome addition 🎉 but I don't think it goes far enough. As mentioned by @Ta-akash, there isn't an obvious way to get a feedback on where the annotation was moved to or that it is even moving. It's also possible this is doable but I've missed how to do it in the docs.
Also, it would be very useful to allow dragging annotations without having to perform a long press gesture or at least mention that in the docs. I had to read the code to understand that I needed to long press on an annotation before it would become draggable.
Yeah, agreed. It's there but essentially unuseable (perhaps through some complicated gesture recogniser stuff!).
Feedback on what has been dragged where is essentially for this to be a useable feature.
The current draggable implementation added in 10.10.0 is a welcome addition 🎉 but I don't think it goes far enough. As mentioned by @Ta-akash, there isn't an obvious way to get a feedback on where the annotation was moved to or that it is even moving. It's also possible this is doable but I've missed how to do it in the docs.
Also, it would be very useful to allow dragging annotations without having to perform a long press gesture or at least mention that in the docs. I had to read the code to understand that I needed to long press on an annotation before it would become draggable.
I agree, I can't use the current implementation either.
Maybe file a new bug? I've had poor luck getting responses on closed bugs from this team.
On Mon, Jan 29, 2024 at 8:59 AM paulsUsername @.***> wrote:
Yeah, agreed. It's there but essentially unuseable (perhaps through some complicated gesture recogniser stuff!).
Feedback on what has been dragged where is essentially for this to be a useable feature.
The current draggable implementation added in 10.10.0 is a welcome addition 🎉 but I don't think it goes far enough. As mentioned by @Ta-akash https://github.com/Ta-akash, there isn't an obvious way to get a feedback on where the annotation was moved to or that it is even moving. It's also possible this is doable but I've missed how to do it in the docs.
Also, it would be very useful to allow dragging annotations without having to perform a long press gesture or at least mention that in the docs. I had to read the code to understand that I needed to long press on an annotation before it would become draggable.
— Reply to this email directly, view it on GitHub https://github.com/mapbox/mapbox-maps-ios/issues/501#issuecomment-1915167388, or unsubscribe https://github.com/notifications/unsubscribe-auth/AARJJ4UA6DXA26AHXLUU2R3YQ7IOZAVCNFSM47MOE3QKU5DIOJSWCZC7NNSXTN2JONZXKZKDN5WW2ZLOOQ5TCOJRGUYTMNZTHA4A . You are receiving this because you are subscribed to this thread.Message ID: @.***>
@akirmse For me its vital. There must be a workaround, using touch events and query render features or something like that. If I make any progress I'll let you know! Have you tried anything like that?
No, I had to disable the corresponding feature. It works in the part of my app that uses Google Maps. That sure doesn't make Mapbox look too good!
On Tue, Jan 30, 2024 at 12:37 AM paulsUsername @.***> wrote:
@akirmse https://github.com/akirmse For me its vital. There must be a workaround, using touch events and query render features or something like that. If I make any progress I'll let you know! Have you tried anything like that?
— Reply to this email directly, view it on GitHub https://github.com/mapbox/mapbox-maps-ios/issues/501#issuecomment-1916325838, or unsubscribe https://github.com/notifications/unsubscribe-auth/AARJJ4XYCYBERPI6KZUC3WTYRCWNZAVCNFSM47MOE3QKU5DIOJSWCZC7NNSXTN2JONZXKZKDN5WW2ZLOOQ5TCOJRGYZTENJYGM4A . You are receiving this because you were mentioned.Message ID: @.***>
@akirmse I put something together and it's now in Main! You can now get these events on point annotations.
https://docs.tilestream.net/ios/maps/api/latest/documentation/mapboxmaps/pointannotation/dragbeginhandler/