问题描述
我已经实现了带有搜索框的Google地图,允许用户通过搜索来选择地址.
I have implemented Google map with search box in it which allows user to select address by searching it.
在该搜索框中,即使我输入了1个字符,它也会搜索..我希望用户至少输入3个字符,否则它就不应进行搜索.
In that search box, even if I am typing 1 character it searches.. I want user to type at least 3 characters else it should not go for search.
My JS Fiddle is: http://jsfiddle.net/upsidown/2NhsE/
我该怎么做?Google是否提供该限制?
How can I do this? Is Google provides that restriction?
推荐答案
Google目前未为场所自动填充元素提供此选项.
Google doesn't provide this option for places autocomplete element at the moment.
公共问题跟踪器中有一个功能请求.看看问题5831 .该问题的状态为已接受",但是没有暴露任何ETA.您可以为这个问题加注星标,以增加投票并获得更多更新.
There is a feature requests in the public issue tracker. Have a look at issue 5831. The issue's status is Accepted, however there is no any ETA exposed. You can star this issue to add your vote and receive further updates.
还有一个评论#15并推荐如何使用自动完成服务实现此功能.
Also there is a comment #15 with recommendation how to implement this using autocomplete service.
更新:2018年6月4日
此功能被标记为不会修复(已淘汰)
这篇关于Google地图自动完成功能-最多3个字符类型的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!