Javascript 按国家筛选谷歌地图搜索窃窃私语器的输出地址
在谷歌自动补全系统中,是否可以为仅来自一个国家的地址制作窃窃私语器? 所以当你们开始在搜索框里写东西时,它只会给你们一个特定国家的地址 要使用位置库的:Javascript 按国家筛选谷歌地图搜索窃窃私语器的输出地址,javascript,google-maps-api-3,autocomplete,Javascript,Google Maps Api 3,Autocomplete,在谷歌自动补全系统中,是否可以为仅来自一个国家的地址制作窃窃私语器? 所以当你们开始在搜索框里写东西时,它只会给你们一个特定国家的地址 要使用位置库的: new google.maps.places.Autocomplete(document.getElementById('autocomplete'), { types: ['geocode'], componentRestrictions: { country: 'de' // ISO 3166-1 Alpha
new google.maps.places.Autocomplete(document.getElementById('autocomplete'), {
types: ['geocode'],
componentRestrictions: {
country: 'de' // ISO 3166-1 Alpha-2 country code, case insensitive
}
});
希望这有帮助