简体   繁体   中英

iPhone sdk MapDistance

Can anyone help me "How to calculate distance between two places in MAP(CLLocation).Tell the delegates,methods etc to be used .

Thanks in advance,

BrightRaj

You can use this method in CLLocation that takes another CLLocation object and returns the distance in meters:

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

Be aware that it's available only in iOS ≥3.2. If you wanna target older iOS versions, use

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

This method is marked as deprecated and will disappear at some time in the future.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM