Google Places API Autocomplete

I have some questions about google places api for android.

This is a request that is called:

https://maps.googleapis.com/maps/api/place/autocomplete/json?sensor=false&key=API_KEY&components=country:hr&language=hr&input=lad

The problem is that I only want addresses in a specific city. Is it possible?

Here is a quote from the Google Places API Autocomplete that suggests it should work.

Blockquote A collection of types (regions) tells the Place service to return any result that matches the following types:

  • location
  • sublocality
  • postal_code
  • country
  • administrative_area1
  • administrative_area2

Blockquote A collection of types (cities) tells the Place service to return results matching either the locale or Administrative_area3.

Therefore, I would like to specify a quote or postal code to filter out only addreses from this city.

- EDIT -

This approach also does not work.

maps.googleapis.com/maps/api/place/autocomplete/json?sensor=false&key=API_KEY&types=geocode&location=45.811093,15.974121&radius=12000&components=country:hr&language= h & entry = lad

+4
source share
1 answer

Decision

I added the name CIty to the input line

city_name + street, like Zagreb + fal, to get all the streets from Zagreb with fal * on their behalf.

Oke seems to work.

+2
source

Source: https://habr.com/ru/post/1480424/


All Articles