javascriptjquerygoogle-mapsgoogle-maps-api-3search-box

Google map autocomplete - maximum 3 character type


I have implemented Google map with search box in it which allows user to select address by searching it.

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/

How can I do this? Is Google provides that restriction?


Solution

  • Google doesn't provide this option for places autocomplete element at the moment.

    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.

    Also there is a comment #15 with recommendation how to implement this using autocomplete service.


    Update: 04 June 2018

    This feature was marked as Won't Fix (Obsolete)

    This feature request is obsoleted by the new session-based billing for Places autocomplete. Please refer to the "Place Autocomplete" section of https://cloud.google.com/maps-platform/user-guide/pricing-changes/ for more details.