Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

How to rotate iOS MKMapView so that it north-oriented when switching tracking mode?

I am working on an iPhone app (iOS 6.1), and I use MKMapView to display a map in my app.

I am switching between the three different map orientation modes using MKUserTrackingModeNone, MKUserTrackingModeFollow, MKUserTrackingModeFollowWithHeading and this works.

However I have a problem with the orientation of the map not resetting to north-facing orientation (north on the map being at the top of the screen) when switching from MKUserTrackingModeFollowWithHeading to MKUserTrackingModeNone.

On the built-in maps app on the ipad, the flow is like this:

  1. When you start the app it is in mode MKUserTrackingModeNone and is north-oriented
  2. When you toggle the orientation mode it changes to MKUserTrackingModeFollow, and the orientation is still north.
  3. When you switch again, it changes to MKUserTrackingModeFollowWithHeading, and the map rotates according to the direction you are facing/pointing the iPad.
  4. When you switch orientation again, it goes back to MKUserTrackingModeNone, and the map nicely rotates back to being north-oriented.

I would like my app to behave in the same way in regards to orientation when switching mode, but when I do as in step 4 above and switch from MKUserTrackingModeFollowWithHeading to MKUserTrackingModeNone, the orientation stays as it was just before making the orientation switch instead of rotating back to north orientation.

I am making the orientation switch with the standard MKUserTrackingBarButtonItem control placed in a toolbar.

Any ideas of how to solve this?

Thanks!

iPhone 4, iOS 6.1

Posted on Jan 31, 2013 10:45 PM

Reply

There are no replies.

How to rotate iOS MKMapView so that it north-oriented when switching tracking mode?

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.