gpt4 book ai didi

google-maps - Place Details API 的 short_name 的变化

转载 作者:行者123 更新时间:2023-12-05 07:43:38 25 4
gpt4 key购买 nike

Google 响应的格式是否发生了变化?几天后,当我使用对应国家/地区的 place_id 参数查询 API 时,我不再获得任何国家/地区代码 (alpha2)。

例如:

# Query for "France"
# http://maps.googleapis.com/maps/api/js/GeocodeService.Search?7sUS&9sen&14sChIJMVd4MymgVA0R99lHx5Y__Ws&key=[API_KEY]

"results" : [
{
"address_components" : [
{
"long_name" : "France",
"short_name" : "France", <= Used to be "FR"
"types" : [ "country", "political" ]
}
],
"formatted_address" : "France",
....
},
"place_id" : "ChIJMVd4MymgVA0R99lHx5Y__Ws",
"types" : [ "country", "political" ]
}
],
"status" : "OK"
}

但是当我对法国巴黎执行相同的查询时:

"results" : [
{
"address_components" : [
{
"long_name" : "Paris",
"short_name" : "Paris",
"types" : [ "locality", "political" ]
},
{
"long_name" : "Paris",
"short_name" : "Paris",
"types" : [ "administrative_area_level_2", "political" ]
},
{
"long_name" : "Île-de-France",
"short_name" : "Île-de-France",
"types" : [ "administrative_area_level_1", "political" ]
},
{
"long_name" : "France",
"short_name" : "FR", <== Still "FR"
"types" : [ "country", "political" ]
}
],
"formatted_address" : "Paris, France",
"geometry" : {
"bounds" : {
"northeast" : {
"lat" : 48.9021449,
"lng" : 2.4699208
},
"southwest" : {
"lat" : 48.815573,
"lng" : 2.224199
}
},
"location" : {
"lat" : 48.856614,
"lng" : 2.3522219
},
"location_type" : "APPROXIMATE",
"viewport" : {
"northeast" : {
"lat" : 48.9021449,
"lng" : 2.4699208
},
"southwest" : {
"lat" : 48.815573,
"lng" : 2.225193
}
}
},
"place_id" : "ChIJD7fiBh9u5kcRYJSMaMOCCwQ",
"types" : [ "locality", "political" ]
}
],
"status" : "OK"
}
)

它真的变了吗?如果是这样,我怎样才能得到相应的 country_code 来查询一个国家?

谢谢你的帮助

最佳答案

这似乎是一个错误。请查看公共(public)问题跟踪器中的报告:

https://issuetracker.google.com/issues/37479392

请随时添加您的评论并为问题加注星标。

更新

Google 于 2017 年 4 月 27 日解决了该问题。

关于google-maps - Place Details API 的 short_name 的变化,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43611784/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com