我想谷歌自动完成建议,只列出住宿和位置。我主要是尝试让住宿类型的工作,但没有任何建议出现。
当我从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);发布于 2013-05-01 17:57:25
我不认为住宿是有效的选择,根据以下链接…
https://developers.google.com/maps/documentation/javascript/places#places_autocomplete
你应该试着跟随……
https://developers.google.com/maps/documentation/javascript/examples/places-queryprediction
在示例中用“lodging”代替"pizza“...:)
https://stackoverflow.com/questions/16165173
复制相似问题