Skip to content Skip to sidebar Skip to footer

How To Get The Autocomplete List Based On Array Of Cities Using Javascript

I need to get the autocomplete values based on some city using google place API in Javascript. But as per my code its not working as expected. Here I have some cities in array like

Solution 1:

It is not currently possible to restrict Places Autocomplete results to specific cities/localities. As a workaround for now, you can bias the autocomplete results to favor an approximate location or area as stated in this documentation.

There is also an existing feature request to filter using route, locality, administrative_area, postal_code and country in the Places API autocomplete. I'd recommend you "star" it to receive updates. https://issuetracker.google.com/issues/35822067

Hope this helps!

Post a Comment for "How To Get The Autocomplete List Based On Array Of Cities Using Javascript"