我正在寻找一个示例查询,它返回一个仅仅是餐馆的列表,用作自动完成,给定一段带有或不带坐标位置的部分文本 .
我看到了一个地理编码的例子,但这会返回物理位置 .
我尝试使用type = establishment,但我得到了许多不是餐馆的结果 .
试试这个代码 . 您可以随时查看google places api的文档以获取此类问题 . 支持的类型列出here
<label for="restaurant"> <input id="restaurant" name="restaurant"> </label> <script> var input = document.getElementById('restaurant'); var options = { types: ['(restaurant)'] }; var searchBox = new google.maps.places.SearchBox(input,options); </script>
您似乎对此功能请求感兴趣:Issue 3538: Allow Places types in autocomplete .
2 回答
试试这个代码 . 您可以随时查看google places api的文档以获取此类问题 . 支持的类型列出here
您似乎对此功能请求感兴趣:Issue 3538: Allow Places types in autocomplete .