- iOS/Objective-C 元类和类别
- objective-c - -1001 错误,当 NSURLSession 通过 httpproxy 和/etc/hosts
- java - 使用网络类获取 url 地址
- ios - 推送通知中不播放声音
我有两个成对使用的应用程序,都使用 GMSServices 的 GMSGeocoder 进行反向地理编码坐标搜索。但在第一个结果中,结果以英语显示,在其他结果中以设备本地语言显示。设备相同。
我查了很多,发现现在没有办法让GMSGeocoder使用指定语言的结果。这是不可能的,我们应该改用 google API 请求。但它以某种方式起作用,我不知道如何让第二个应用程序仅以英语返回结果。
类似的问题 mapView - 同一设备上的不同语言。
如何在不考虑设备本地化的情况下为 GMSServices 设置英语?
最佳答案
GMSGeocoder 向您发送了县名,但没有发送国家/地区 ISO 代码。
您可以使用 native CLGeocoder 类从纬度和经度获取 counytyISOcode。例如:
CLLocation *location = (your location)
CLGeocoder *geocoder = [[CLGeocoder alloc] init];
[geocoder reverseGeocodeLocation:location completionHandler:
^(NSArray* placemarks, NSError* error){
if ([placemarks count] > 0)
{
CLPlacemark *placemark = [placemarks objectAtIndex:0];
NSLog(@"Your counry is %@",placemark. ISOcountryCode);
}
}];
关于ios - GMSServices GMSGeocoder reverseGeocodeCoordinate IOS返回结果的语言,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31924147/
在国外使用我的应用程序时,google GMSGeocoder 会自动以本地语言返回响应。我怎样才能将它设置为始终以英文返回响应? 我使用的是 GMS SDK 1.7,我的代码是这样的: GMSGeo
我正在滚动浏览 Assets 组中的每个 Assets ,并尝试从 Google Maps sdk 1.9.1 中使用的图像的现有数据中检索位置。这是我写的代码 -(NSString *) doRev
我有两个成对使用的应用程序,都使用 GMSServices 的 GMSGeocoder 进行反向地理编码坐标搜索。但在第一个结果中,结果以英语显示,在其他结果中以设备本地语言显示。设备相同。 我查了很
我需要从 2 个坐标获取城市名称(我正在使用 GMSGeoCoder -reverseGeocodeCooperative:completionHandler: 方法),然后对对象进行 comapre
我找不到在 MKMapView 上使用地理编码的任何代码或任何教程。有没有人可以指导我解决我的问题? 最佳答案 How to obtain country, state, city from reve
我目前正在开发一个 IOS 应用程序来使用谷歌地图地理编码库反转地理编码坐标,特别是使用 GMSGeocoder 类,我总是得到地点和街道名称,但子地点始终为空,但是当我使用 android geoc
有没有办法在 iOS Swift 中使用 GMS 从输入的地址字符串中获取坐标?我可以找到从坐标返回地址的示例(反向地理编码?),但反之则不行。谷歌提供这项服务吗?首先解析输入的地址字符串,返回最合适
我是一名优秀的程序员,十分优秀!