Zoom programmatically using MKUserTrackingModeFollowWithHeading

I want to zoom out to include the coming annotations when the map view is in MKUserTrackingModeFollowWithHeading mode.

I tried to set the scope as follows:

MKCoordinateRegion currentRegion = self.mapView.region; currentRegion.span.latitudeDelta *= 4; currentRegion.span.longitudeDelta *= 4; [self.mapView setRegion:currentRegion]; 

This reduces the scale of the 4x map, but when iOS user tracking is turned on, it automatically zooms in using animations. I canโ€™t make any region hold on. I assume MapRect will have the same behavior, but I have not tried it.

Does anyone know of another way to do this?

According to the documentation for setUserTrackingMode:

If the map is reduced, the map display will automatically increase at the location of users, effectively changing the current visible area.

So, I understand that this may not be possible. However, the user can pinch to reduce the scale, and the userโ€™s tracking mode remains on without changing the time. Any creative ideas are greatly appreciated.

+4
source share
1 answer

You cannot control the zoom 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 allows you to customize this behavior.

+1
source

All Articles