I want to zoom out to include the nearest annotations while the map view is in MKUserTrackingModeFollowWithHeading mode.
I've tried to set the region like this:
MKCoordinateRegion currentRegion = self.mapView.region;
currentRegion.span.latitudeDelta *= 4;
currentRegion.span.longitudeDelta *= 4;
[self.mapView setRegion:currentRegion];
This zooms out the map 4x, but with the user tracking enabled, iOS automatically zooms back into the original zoom level with animation. I can't get any region to stick. I assume a MapRect would have the same behavior, but I haven't tried it.
Does anyone know of another way to do this?
According to the documentation on setUserTrackingMode:
If the map is zoomed out, the map view automatically zooms in on the user’s location, effectively changing the current visible region.
So I realize that this might be impossible. However, the user can pinch to zoom out, and the user tracking mode remains enabled without zooming back in. Any creative ideas are greatly appreciated.
You can't control the zooming behavior when using the built-in tracking modes. You might want to check out something like the MapBox iOS SDK which has the same look and behavior as MapKit, but would allow you to customize this behavior.
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