Search code examples
iphoneobjective-cmkmapviewcllocationmanagercompass-geolocation

iOS iPhone show user direction and orientation in space like the compass app on MKMapView


When the compass app uses a map view to display it's location, there's a little cone that displays the direction in which the phone is pointing. However, I was unable to reproduce it using MKMapView that shows user's location. Is this cone of sight feature available to developers, or will I have to implement one myself?

iPhone compass map app

Thank you!


Solution

  • I faced a similar situation. I don't think we have library or settings to display the direction on the blue icon (at least my search was not successful).

    However it is not difficult to create our own direction indicator using the CLHeading (reference in TommyG's answer).

    What I did was to display the blue icon as in the map and provide a small arrow in a different view to indicate the direction.

    Hope this helps in some way