I want to rotate the Map of my MKMapView component to the direction the user is walking/driving.
I don't want that the map is centered and zoomed automatically. Thats the reason why I don't use setUserTrackingMode:MKUserTrackingModeFollowWithHeading
.
I tried to use the heading of location updates and call the setTransform method of the mapView:
- (void)headingUpdate:(CLHeading *)newHeading
{
[self.mapView setTransform:CGAffineTransformMakeRotation(-1 * newHeading.magneticHeading * M_PI / 180)];
}
The problem is that the whole view (not only the content / map) itself is rotated, see screenshot:
Does anyone have an idea? I only want to set the direction the user is walking (no zooming, centering etc.)