Created
September 10, 2014 15:08
-
-
Save ryanhanwu/7c38fde580e64e0ca7a6 to your computer and use it in GitHub Desktop.
Calculate distance between two location
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#import <CoreLocation/CoreLocation.h> | |
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 square meter == 10.76 square feet |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment