【问题标题】:How to get localized street name from coordinates?如何从坐标中获取本地化街道名称?
【发布时间】:2012-07-09 11:40:55
【问题描述】:

我使用 CLGeocoder 从地理坐标中获取地址。

self.geocoder = [[CLGeocoder alloc] init]; 
///

[self.geocoder reverseGeocodeLocation:loc completionHandler:^(NSArray *placemarks, NSError *error) {
      if (placemarks.count) {
             CLPlacemark *placemark = [placemarks objectAtIndex:0];

             NSString *string = ((NSString *)[[placemark addressDictionary] objectForKey:kABPersonAddressStreetKey];
     }
}]);

据我了解,CLGeocoder 以“本地”本地化返回街道名称(如果我们在乌克兰并选择乌克兰语言环境 - 我们将获得乌克兰本地化街道名称)。

此代码返回我的字符串,本地化为我当前的位置(乌克兰)。 如果语言环境设置为另一个位置,它会给我街道的英文本地化名称。 如何强制 CLGeocoder 只给我特定位置的地址?

【问题讨论】:

    标签: ios localization reverse-geocoding


    【解决方案1】:

    不幸的是,我对GLGeocoder 一无所知,但我过去曾使用Google Maps API 处理这类事情,恕我直言,效果非常好。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多