2015-11-02 2 views
1

Можно ли фильтровать более 1 страны?Google autocomplete Ограничения более 1 страны

Я попытался это:

componentRestrictions: {country: "us","uk"} 

но то не работал.

полный код:

<script src="http://maps.googleapis.com/maps/api/js?sensor=false&amp;libraries=places" type="text/javascript"></script> 
<script type="text/javascript"> 
    function initialize() { 
     var options = { 
    types: ['(cities)'], 
    componentRestrictions: {country: "us","uk"} 
}; 

var input = document.getElementById('searchTextField'); 
var autocomplete = new google.maps.places.Autocomplete(input, options); 

} 

    google.maps.event.addDomListener(window, 'load', initialize); 
</script> 

ответ

0
componentRestrictions: {country: "us", country: "ca"} 

его работы как шарм :)

+0

не работал для меня, он просто берет последнюю страну – simplesystems

Смежные вопросы