5
Googleレスポンスの形式が変更されましたか? 数日から、国に対応するplace_idパラメータを使用してAPIにクエリを実行すると、国コード(alpha2)はもう取得されません。プレイス詳細APIのshort_nameの変更
たとえば:
# 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"
}
)
DITが、それは実際に変更?もしそうなら、どのようにして国に関する質問に対応するcountry_codeを取得できますか?
ありがとうございました