gpt4 book ai didi

google-maps - Place Details API 的 short_name 更改

转载 作者:行者123 更新时间:2023-12-04 18:25:26 27 4
gpt4 key购买 nike

谷歌回复的格式有变化吗?
几天以来,当我使用与国家/地区对应的 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/43595957/

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