Return to Snippet

Revision: 23313
at February 3, 2010 22:44 by espinallab


Initial Code
CLLocation *userLoc = [[CLLocation alloc] initWithCoordinate:appDelegate.mapView2.userLocation.coordinate];
CLLocation *poiLoc = [[CLLocation alloc] initWithLatitude: [aPOI.latitude doubleValue] longitude: [aPOI.longitude doubleValue]];
	
double dist = [userLoc getDistanceFrom:poiLoc] / 1000;
	
NSLog(@"%f",dist);

Initial URL
http://www.iphonedevsdk.com/forum/iphone-sdk-development/35043-calculate-distance-between-two-latitudes-longitudes.html

Initial Description

                                

Initial Title
Calculate distance between two latitudes / longitudes

Initial Tags

                                

Initial Language
Objective C