Google Maps places API to only return cities?

后端 未结 2 1495
星月不相逢
星月不相逢 2021-02-07 15:36

I am trying to use Google\'s map API to only return cities from their json request:

 https://maps.googleapis.com/maps/api/place/autocomplete/json?input=green%20l         


        
2条回答
  •  时光取名叫无心
    2021-02-07 16:07

    https://maps.googleapis.com/maps/api/place/autocomplete/json?input=green%20lanes&types=geocode&sensor=false&types=regions&key=API KEY HERE

    should be

    https://maps.googleapis.com/maps/api/place/autocomplete/json?input=green%20lanes&sensor=false&types=(regions)&key=API KEY HERE

    ZERO RESULTS, because regions does not search for street name:

    the (regions) type collection instructs the Place service to return any result matching the following types: locality sublocality postal_code country administrative_area1 administrative_area2

提交回复
热议问题