2

我有当前位置的坐标,但如何将这些坐标转换为地名?我不想显示地图视图。由于 MKReverseGeocoder 在 iOS 5 中已被弃用,有没有其他方法可以实现这一点。提前致谢 。

4

1 回答 1

0

您可以访问 Google Places Api

http://maps.google.com/maps/geo?q=yourSearchName&output=xml

这将提供有关所提供的搜索名称的详细信息。您可以解析 xml 并从该详细信息中获取纬度和经度,并可以固定注释这些位置。

输出也可以是 json 和 csv。

一些可以提供帮助的代码

 NSString *urlString = [NSString stringWithFormat:@"http://maps.google.com/maps/geo?q=%@&output=csv",coordinate];   //coordinate=-30.347744,71.3737373
 NSString *locationString = [NSString  stringWithContentsOfURL:[NSURL URLWithString:urlString]];
 NSArray *listItems = [locationString componentsSeparatedByString:@","];

在此处参考 Google API

于 2012-04-06T07:04:05.653 回答