Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Use mapkit to calculate driving distance between two addresses?

Is it possible to use the mapkit in the iphone sdk to calculate driving distance between two addresses ?

like image 614
eemceebee Avatar asked Feb 03 '10 17:02

eemceebee


2 Answers

How about using the Core Location framework:

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

You'll need the latitude/longitudes for both addresses.

Edit: Deprecated in iOS 3.2. Use the distanceFromLocation: method instead.

like image 88
Marco Avatar answered Oct 22 '22 17:10

Marco


With iOS7 you get full directions within the API

Take a look at this tutorial Tutorial.

like image 30
brainray Avatar answered Oct 22 '22 17:10

brainray