Google Geocode API:' administrative_area:in | country:US'未找到

时间:2018-05-23 16:05:18

标签: google-maps google-geocoding-api geocode

1 个答案:

答案 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"