为什么这会找到印第安纳州: https://maps.google.com/maps/api/geocode/json?components=administrative_area:in
但这不是吗? https://maps.google.com/maps/api/geocode/json?components=administrative_area:in|country:US
答案 0 :(得分:0)
如果您使用ind
而不是in
,则可以正常使用。
https://maps.google.com/maps/api/geocode/json?components=country:US|administrative_area:ind&key=
{
"results" : [
{
"address_components" : [
{
"long_name" : "Indiana",
"short_name" : "IN",
"types" : [ "administrative_area_level_1", "political" ]
},
{
"long_name" : "United States",
"short_name" : "US",
"types" : [ "country", "political" ]
}
],
"formatted_address" : "Indiana, USA",
"geometry" : {
"bounds" : {
"northeast" : {
"lat" : 41.761368,
"lng" : -84.784662
},
"southwest" : {
"lat" : 37.7717419,
"lng" : -88.097892
}
},
"location" : {
"lat" : 40.2671941,
"lng" : -86.1349019
},
"location_type" : "APPROXIMATE",
"viewport" : {
"northeast" : {
"lat" : 41.761368,
"lng" : -84.784662
},
"southwest" : {
"lat" : 37.7717419,
"lng" : -88.097892
}
}
},
"place_id" : "ChIJHRv42bxQa4gRcuwyy84vEH4",
"types" : [ "administrative_area_level_1", "political" ]
}
],
"status" : "OK"