Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

MKMapView rotation

Apple's latest Maps application allows a user to rotate a map. How can I add this functionality to my MKMapView? I presumed it'd just be a case of setting a boolean property (similar to zoomEnabled), but I can't find anything relevant in the documentation.

like image 233
Jonathan Avatar asked May 30 '26 09:05

Jonathan


2 Answers

There is no built-in rotation support in the MapKit of iOS. You could use regular view transforms (but than all street names etc. will also be rotated of course), or you use the Google Maps SDK or MapBox or something else.

The Google Maps SDK does support rotation, even 3D rotation. The SDK Download includes an example project showcasing the functionality.

like image 110
calimarkus Avatar answered Jun 01 '26 01:06

calimarkus


Actually MKMapView does support map rotation starting with iOS 5.0. Either you use the MKUserTrackingBarButtonItem control in your toolbar (user taps it until the map is rotating), or you set the userTrackingMode property to MKUserTrackingModeFollowWithHeading.

like image 31
bio Avatar answered Jun 01 '26 01:06

bio



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!