以下是Google给出的getQueryPredictions示例
service.getQueryPredictions({input: 'pizza near'}, callback);
有没有一种方法可以限制特定国家/地区/城市的结果?
其他功能/组件具有执行此操作的能力
var input = document.getElementById('searchTextField');
var options = { types: ['(cities)'], componentRestrictions: {country: 'fr'}};
autocomplete = new google.maps.places.Autocomplete(input, options);
最佳答案
当前不支持此功能,有关受支持的请求参数,请参见reference documentation。
如果您认为这将是一个有用的功能,请添加Places API - Feature Request。
关于google-maps - Google Places API-getQueryPredictions是否受国家/城市/州的限制?,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/13620308/