Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to calculate distance between two places? Is there any service available by Google Map for iphone?

I want to put facility to display distance between two places selected by user.

Is there any sample source code / service available to do so?

Thanks in advance.

like image 475
Rambo Avatar asked Oct 29 '09 11:10

Rambo


1 Answers

The CoreLocation Framework provides the capability to work out the distance, in meters, between two points:

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

You can initialize a CLLocation object with latitude and longitude:

- (id)initWithLatitude:(CLLocationDegrees)latitude longitude:(CLLocationDegrees)longitude
like image 106
Chris R Avatar answered Oct 14 '22 08:10

Chris R