I play around the Mapkit
and want to rotate the map follow user's heading. It works with this function:
- (void)mapView:(MKMapView *)mapView didUpdateUserLocation:(MKUserLocation *)userLocation
{
_mapView.centerCoordinate =userLocation.location.coordinate;
self.mapView.userTrackingMode = MKUserTrackingModeFollowWithHeading;
}
However, the moment I rotate the map with 2 fingers and it is gone forever. The beam is not there anymore. I add a button to trigger the heading
:
- (IBAction)showHeading:(id)sender {
[self.mapView setUserTrackingMode:MKUserTrackingModeFollowWithHeading animated:YES];
}
But it seems like it is not working.
What I want to do is the map is always rotate to user heading no matter what I do. Any suggestion will be good for now.