Take the 2-minute tour ×

I am developing an iOS app where I need to get the walking route distance between two locations.

I have used CoreLocation API

- (CLLocationDistance)distanceFromLocation:(const CLLocation *)location

As per the documentation This method measures the distance between the two locations by tracing a line between them that follows the curvature of the Earth.

The distance it gave was different from the the one which shown in the iOS map app (after converting to miles) as shown in the figure.

walking route distance

I want to get the walking route distance between two locations which we gets in the map app inside my app. is there any API to get this distance.

Could anyone please help me to achieve this.

share|improve this question

1 Answer 1

up vote 2 down vote accepted

The CoreLocation API does not give distance along a walking route, it can only give you straight line "as the crow flies" distance. You need to query a network service that has a network of streets and walkways to get actual walking distance. CL and MapKit do not provide this service.

You can send a request to Apple Maps app to get walking directions between two points but the results are not provided back to your app, they are presented to the user.

share|improve this answer
Thanks for your answer, So if I request apple map to get the walking direction then default map app will be launched and direction is shown in the default map app right ? –  Prasad Devadiga Jun 27 '13 at 3:57
Yes, that's how it works. There is code to do this in this answer –  progrmr Jun 27 '13 at 13:38
Thanks for the help –  Prasad Devadiga Jun 28 '13 at 3:56

Your Answer


