I am trying to restrict the autocomplete results to Australia only but I can't figure out how to do this ... Where should I pass componentRestrictions ... or there is some other function in the GooglePlacesAutocomplete API ?
Check out the options that GooglePlacesAutocomplete API has for search restriction, it is specified as a comment in example.js:
query={{
// available options: https://developers.google.com/places/web-service/autocomplete
key: 'YOUR API KEY',
language: 'en', // language of the results
types: '(cities)', // default: 'geocode'
}}
Example:
Limit country to Argentina
components: 'country:ar'
What about multiple countries?
How about restrict for country and state Eg : I need to filter only US and Los Angeles data only . @blacktea @sagomezza
Found my answer: components:’country:ca|country:uk’
Most helpful comment
Example:
Limit country to Argentina