Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Change option in Google places autocomplete

Tags:

google-maps

I am working with Google Maps API V3. The following is my code to set-up for autocomplete:

var options = {
        componentRestrictions: {country: elmts.rs_country.val()}
 };
new google.maps.places.Autocomplete(start_address, options);

This works just fine. However, I need to dynamically change the country restriction.

How can I change the 'componentRestrictions' to another country?

like image 328
Lee Loftiss Avatar asked Oct 04 '22 00:10

Lee Loftiss


1 Answers

Please see this Google maps api. You can use the method setComponentRestrictions

like image 160
Alkis Kalogeris Avatar answered Oct 22 '22 20:10

Alkis Kalogeris