是否可以过滤超过1个国家/地区?
我试过了:
componentRestrictions: {country: "us","uk"}
但是没有用。
完整代码:
<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>
答案 0 :(得分:0)
componentRestrictions: {country: "us", country: "ca"}
它的作品就像魅力:)