mapbox / mapbox-annotation-extension

Framework extensions that can be used with the Mapbox Maps SDK for iOS.
ISC License
11 stars 18 forks source link

Moving map deselects annotation #61

Open ritter1 opened 4 years ago

ritter1 commented 4 years ago

Hi!

When I select a style annotation, and then move the map or pinch to zoom, then func annotationController(_ annotationController: MGLAnnotationController, didDeselect styleAnnotation: MGLStyleAnnotation) will be triggered. Is this intended?

The expected behavior is that the style annotation only then gets deselected, when I touch an empty spot on the map or another style annotation. Do I miss something?

All the best

captainbarbosa commented 4 years ago

Hey @ritter1, thanks for trying this library.

I wasn't able to replicate what you're seeing. Below is the test app as current on master - didSelectStyleAnnotation doesn't get called as I pan and zoom with a selected annotation:

annotation-selection

Do you have a minimal test case you can provide do recreate what you're seeing?

ritter1 commented 4 years ago

Hi @captainbarbosa, thanks for getting back to me so quickly!

I meant didDeselect, not didSelect.

As I am moving and zooming, the selected styleAnnotation should remain selected.

ritter1 commented 4 years ago

Hey @captainbarbosa , any update on this?

captainbarbosa commented 4 years ago

Thanks for opening this issue and providing important feedback - I confirm what you're seeing now. Please note that we're a small team and can't always respond quickly. In regards to your comment, I can see what you're experiencing now.

It looks like our main Maps SDK does not do this with regular MGLAnnotations. We should provide a similar behavior here or provide the option to select/deselect MGLStyleAnnotations when the map moves. I've opened https://github.com/mapbox/mapbox-annotation-extension/issues/62 to track this. While I can't guarantee a timeframe for a fix, we will accept third party contributions if you are interested in taking this on.