Reputation: 5461
I am using a Google API autocomplete. i try to restrict only for the Australia. But it suggests every cities in country.for example if i type "new" It suggests New York also. i don't want like that. I want to display only the cities in the Australia
The Working sample is in Jsfiddle.Thanks in advance
Upvotes: 1
Views: 2806
Reputation: 4763
Too late to answer perhaps...
But, this has worked for me:
Put the following in your initialize()
method
var input = document.getElementById('searchTextField');
var options = {
types: ['(cities)'],
componentRestrictions: {country: 'au'}
};
var autocomplete = new google.maps.places.Autocomplete(input, options);
Upvotes: 5