【问题标题】:Forward geocoding using Google Maps SDK on iOS 6在 iOS 6 上使用 Google Maps SDK 转发地理编码
【发布时间】:2014-02-03 18:45:07
【问题描述】:

是否有任何方法可以在 Google Maps SDK 上实现正向地理编码?我不想使用 Google Maps API Web Services。 谢谢

【问题讨论】:

  • 你会考虑使用原生的CLGeocoder类吗?
  • 是的,对我来说可能没问题。谢谢
  • CLGeocoder 在美国以外似乎不准确。我试过英国。尽管在完全支持的国家/地区列表(check here) 中提到了英国,但它提供的数据仍然远非准确。

标签: ios google-maps geocoding clgeocoder


【解决方案1】:

根据您的评论,您可以使用本机 CLGeocoder 类。前向地理编码请求获取用户可读的地址并找到相应的纬度和经度值。

CLGeocoder geocoder = [[CLGeocoder alloc] init];
[geocoder geocodeAddressString:@"1 Infinite Loop"
     completionHandler:^(NSArray* placemarks, NSError* error){
         for (CLPlacemark* aPlacemark in placemarks)
         {
             // Process the placemark.
         }
}];

【讨论】:

  • CLGeocoder 每天有少量请求限制(大约 50 个左右)。最好将Google API 与授权密钥一起使用(限制为每天约 1500 个)。
猜你喜欢
  • 2020-03-15
  • 1970-01-01
  • 1970-01-01
  • 2013-04-05
  • 1970-01-01
  • 2013-02-11
  • 2012-06-08
  • 2010-11-21
  • 2013-12-18
相关资源
最近更新 更多