Saturday 1 December 2012

Calculate distance between two place using latitude-longitude in gmap for iPhone ?

CLLocation *locA = [[CLLocation alloc] initWithLatitude:lat1 longitude:long1];

 CLLocation *locB = [[CLLocation alloc] initWithLatitude:lat2 longitude:long2];

 CLLocationDistance distance = [locA distanceFromLocation:locB];

 //Distance in Meters

 //1 meter == 100 centimeter

 //1 meter == 3.280 feet

 //1 meter == 10.76 square feet


 [locA release];

 [locB release];

No comments:

Post a Comment