我目前正在为iOS开发一个移动应用程序,其中包含需要确定用户当前位置和从当前位置开始的部分,我想查找最近的位置。从我的当前位置获取距离最近的位置
有没有什么办法可以实现呢?
我已经做了一些编码来找到用户的当前位置。 这里是我的代码片段,
CLGeocoder *geocoder = [[CLGeocoder alloc] init];
[geocoder reverseGeocodeLocation:locationManager.location
completionHandler:^(NSArray *placemarks, NSError *error) {
NSLog(@"reverseGeocodeLocation:completionHandler: Completion Handler called!");
if (error){
NSLog(@"Geocode failed with error: %@", error);
return;
}
CLPlacemark *placemark = [placemarks objectAtIndex:0];
NSLog(@"placemarks=%@",[placemarks objectAtIndex:0]);
但我的问题是,我将如何得到最近的其他地点?从我已经提取的当前位置。
在此先感谢。
去[此链接](http://stackoverflow.com/questions/17085668/how-to-find-nearest-latitude-and-longitude-form当前位置),这有类似的问题。我想这会帮助你。 – Suryakant