1
是否可以過濾1個以上的國家?Google autocomplete限制超過1個國家
我嘗試這樣做:
componentRestrictions: {country: "us","uk"}
但didnt工作。
完整代碼:
<script src="http://maps.googleapis.com/maps/api/js?sensor=false&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>
我沒有工作,它只是需要最後一個國家 – simplesystems