如何限制Google Places API搜索的距离?他找到了离我很远的地方,我想限制我到这个地方的距离。
答案 0 :(得分:0)
var input = document.getElementById('id');
var autocompleteOptions = {
//types: ['(cities)'],
componentRestrictions: {country: "us"}
};
var autocomplete = new google.maps.places.Autocomplete(input,autocompleteOptions);