4

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:

enter image description here

Does anyone have an idea? I only want to set the direction the user is walking (no zooming, centering etc.)

Martin Evans
  • 45,791
  • 17
  • 81
  • 97
mario.van.zadel
  • 2,919
  • 14
  • 23
  • 2
    My answer here can help you: http://stackoverflow.com/questions/18936839/programatically-rotating-a-mkmapview-in-ios7 – nevan king May 17 '14 at 11:56

0 Answers0