【发布时间】:2013-04-16 10:06:30
【问题描述】:
我希望 Google 的自动完成建议仅列出住宿和地点。我一直在努力让住宿类型正常工作,但没有出现任何建议。
当我从 autoComplete 变量中删除 ac_options 时,一切正常,但当然没有任何建议被特定类型缩小范围。
var ac_options = {
types: ['lodging']
};
var input = document.getElementById(this.options.autoCompleteInputId);
var autocomplete = new google.maps.places.Autocomplete(input, ac_options);
//bind to input field
autocomplete.bindTo('bounds', this.gmap);
【问题讨论】:
-
您能否在jsfiddle.net 上提供一个示例,说明您目前掌握的情况?
-
我在使用 jsfiddle 时遇到了麻烦,所以最后我没有打扰。在遇到这个问题几天后,我很确定目前无法完成。
标签: google-maps autocomplete google-places-api