pauljohanneskraft / Map

MKMapView wrapper for SwiftUI as drop-in to MapKit's SwiftUI view. Easily extensible annotations and overlays, iOS 13 support and backwards compatible with MKAnnotation and MKOverlay!
MIT License
181 stars 49 forks source link

Annotation selection #22

Open BucekJiri opened 2 years ago

BucekJiri commented 2 years ago

Annotation selection

rmnblm commented 1 year ago

Hi @BucekJiri

Thank you for you contributions to this repository. I've found your additions very helpful, especially the clustered content. However, having another size for the selected content leads to this behavior:

https://user-images.githubusercontent.com/5942764/199796300-55492a61-1ace-4a86-88ee-a4c83b67cffb.mp4

The selected content does not seem to be centered like the unselected content. Did you notice this too? Any idea how to fix this? I could not find a way so far.

By the way: Any idea how to animate the change between unselected to selected?

Thank you very much! -Roman

BucekJiri commented 1 year ago

Hey @rmnblm

great to hear you found it helpful. This PR is a bit outdated and does not contain all the recent changes.

Check this issue. It might help you with the problem.

When it comes to animating the selection, I have not tried that but I believe triggering an animation in the overridden setSelected method in the MKMapAnnotationView could do the trick.