Geocoder.getFromLocation()以阿拉伯语返回地址

时间:2014-01-05 21:42:35

标签: android google-api google-geocoder

我在以色列的Android设备上使用Geocoder。直到几个星期前一切正常,当我进行反向地理编码时,所有地址都以希伯来语收到。但在某些时候,我开始在阿拉伯语中获得相同的地址。

这是一个运行的示例代码(lat / lon在特拉维夫):

Geocoder geocoder = new Geocoder(mContext, Locale.getDefault());
List<Address> addresses = geocoder.getFromLocation(32.087765863162346, 34.781454205513, 1);

当我检查'地址'时,我得到以下打印输出:

  

[地址[addressLines = [0:“عمنوئيلهرومي26”,1:“Tel Aviv”,2:“Israel”],feature = 26,admin = null,sub-admin = null,locality = Tel Aviv, thoroughfare =عمنوئيلهرومي,postalCode = null,countryCode = IL,countryName = Israel,hasLatitude = true,latitude = 32.0877767,hasLongitude = true,longitude = 34.7813859,phone = null,url = null,extras = null]]

请注意,这些设备未定位到以色列。意思是,Locale.getDefault()将“US”和“en”作为国家和语言代码。

我已经在地理编码器问题跟踪器http://code.google.com/p/gmaps-api-issues/issues/detail?id=6182中打开了一个错误 - 但是被引用到Android问题跟踪器。在那边打开另一个 - https://code.google.com/p/android/issues/detail?id=64382 - 但似乎这个bug甚至不在Android设备端,而是在Geocoder后端服务中。所以我处于死胡同。

如果知道任何知道Google负责任团队成员的人会让他们知道,我会很感激。感谢。

编辑,因为我觉得这里发布的问题并非完全形成为问题,我不会非常感激,让我重新说一句 - 有没有人知道问题跟踪器哪里有可能打开一个关于android Geocoder后端服务?再次,谢谢。

1 个答案:

答案 0 :(得分:5)

我遇到了同样的问题,我通过在Geocoder init中设置Locale来修复它, 你可以这样做:

Locale lHebrew = new Locale("he");
Geocoder geocoder = new Geocoder(this, lHebrew);

如果问题已经解决,请告诉我。

相关问题