密码中的Google Apis Geocode不一致(同一种语言)

时间:2017-08-23 14:52:21

标签: json google-maps google-maps-api-3

我使用Google API Geocodes从给定的地址检索管理级别。如果我尝试使用西班牙巴利亚多利德(http://maps.google.com/maps/api/geocode/json?sensor=false&address=Valladolid,Spain&language=en),我会将其作为administrative_area_level_2.short_name:VA。

<string-array name="syncFrequency">
    <item name="1">Block All Calls</item>
    <item name="2">Block Black List</item>
    <item name="3">Block Unknown Calls</item>
    <item name="4">Allow White List</item>
    <item name="5">Receive All Calls</item>
</string-array>




<string-array name="syncFrequencyValues">
    <item name="1">Block_All_Calls</item>
    <item name="2">Block_Black_List</item>
    <item name="3">Block_Unknown_Calls</item>
    <item name="4">Allow_White_List</item>
    <item name="5">Receive_All_Calls</item>
</string-array>



     <ListPreference
        android:key="prefSyncFrequency"
        android:entries="@array/syncFrequency"
        android:summary="%s"
        android:defaultValue="Block_Black_List"
        android:entryValues="@array/syncFrequencyValues"
        android:title="@string/call_block_options" />

但如果我尝试西班牙塞维利亚(http://maps.google.com/maps/api/geocode/json?sensor=false&address=Seville,Spain&language=en):

.element {
   bottom: 0;
   height: 100%;
   left: -100%;
   position: fixed;
   right: auto;
   top: 0;
   width: 100%;
   transition: left .3s ease-in;
}

.element.active {
   left: 0;
   right: 0;
}

短名称是Seville而不是SE。

有谁知道如何跳过这个问题?我和几个国家合作,其中一些国家有这个问题。

提前致谢。

1 个答案:

答案 0 :(得分:0)

我当然不能说,但这可能是Google方面的数据问题。我认为Valladolid的管理区域级别2存储在数据库中的缩写值,而Sevilla的管理区域级别2没有存储缩写值,因此Geocoding API使用完整名称。

您应该向Google发送反馈。在Google地图中打开Sevilla管理区域2级

https://www.google.com/maps/place/Seville/@37.5145054,-6.7170897,8z/data=!3m1!4b1!4m5!3m4!1s0xd12f2dae16bd169:0x30463fd8c9fcbc0!8m2!3d37.3376829!4d-5.5617279

并点击发送反馈,如我的屏幕截图所示

enter image description here

我希望这有帮助!