views:

600

answers:

2

Hi

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

Thanks for the help.

+1  A: 

No but if you have the longitude/latitude then it is fairly easy to calculate the distance. It is the mathematical distance between those points of course. Not the actual driving or walking distance that is based on an actual route.

St3fan
Well, unfortunately I need the driving distance. I do not need to display it, just get the distance.
eemceebee
+3  A: 

How about using the Core Location framework:

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

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

Marco
Yeah, that might be the fallback solutions. But as I said before I would like to have the driving distance not just the distance between 2 locations.The question remains, is there a way to get the location from the mapkit ? Like I enter a address and it gives me the location ?
eemceebee