I have a grouped pin that I want to zoom in on. Of course I know the coords of the pin, and have it's view rect. I just want to zoom the map to just the right region so that the cluster fully expands showing all pins (plus a bit of padding). What's a good way of doing this?
Sidenote:
In my setup the cluster pin will automatically be expanded into individual pins when the zoom level increases so I'm good there. What I need to know is how to set the MapView to a new region based on the frame and coords of the cluster pin.
You can use:
mapView.showAnnotations(groupedAnnotations, animated: true)
This method will zoom in and position the map automatically so the annotations are all visible.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With