我从文档中了解到,我们可以使用函数distanceFromLocation:来计算两个CLLocation点之间的距离。但我的问题是我没有CLLocation数据类型,我有CLLocationCoordinate2D点。那么如何找到两个CLLocationCoordinate2D点之间的距离呢?我看过post的帖子,但对我没有帮助。
发布于 2012-06-18 13:42:02
您应该使用以下命令创建CLLocation对象:
- (id)initWithLatitude:(CLLocationDegrees)latitude
longitude:(CLLocationDegrees)longitude;然后,您应该能够使用以下命令计算距离
[location1 distanceFromLocation:location2];https://stackoverflow.com/questions/11077425
复制相似问题