我想只在阿姆斯特丹(荷兰)搜索地址,我尝试了它的边界,在字符串中添加了& input = amsterdam但是stil显示了更多的城市
html:
<input id="autocomplete" name=origin type=text placeholder=Vertreklocatie class="autocomplete">
JS
function initialize() {
var inputs = document.getElementsByClassName('autocomplete');
var southWest = new google.maps.LatLng( 52.318274,4.728856 );
var northEast = new google.maps.LatLng( 52.431157,5.068373 );
var hyderabadBounds = new google.maps.LatLngBounds( southWest, northEast );
var options = {
bounds: hyderabadBounds,
componentRestrictions: {country: 'nl'},
types: ['address']
};
for(var i = 0; i < inputs.length; i++){
new google.maps.places.Autocomplete(inputs[i], options);
}
}
google.maps.event.addDomListener(window, 'load', initialize);
是否只能在一个城市进行搜索?