
Alternatively, offer to autocomplete on your stores information if the first use case is to help users find them.Use the Geocoding API to retrieve address information instead of getDetails() from Autocomplete.Implement Debounce and minChars mechanisms.Gather only required fields when getting details of a place.Prefer using the AutocompleteService instead of the Widgets to gain fine-grained control over the available optimizations.To optimize Google Places Autocomplete, we recommend the following guidelines: If you search for "Coleman Coffee", the autocomplete fall back on Google Places (there is no Starbucks coffee with this name). In the below sample, search for "London" and select one of the coffee shops suggestion in the pick list. If no results are available (insufficient matching score between the field name of Starbucks coffee shops and the user input), a Google places Autocomplete is performed. The following sample autocomplete for Starbucks coffee shops. How MultiSearch combines autocomplete services?Īutocomplete services are requested in your desired ordered.īy comparing the user input to the returned results and computing a string matching score between these two values, the library can automatically switch to the next autocomplete service and thereby provide suggestions that better suits the needs.įor more details, check fallback concept doc. If your users are more likely to search for postal codes or localities, the MultiSearch can also retrieve suggestions from Woosmap Localities. Moreover, the library implements natively debounce and minchars mechanisms. It enables you to combine stores search (through Woosmap Search API) and Google Places APIs (Places Autocomplete and Places Details).

This small JavaScript library is designed to return location suggestions through calling several autocomplete services. To easily implement such a solution, have a look at Woosmap MultiSearch. If you're a Woosmap customer and already have your stores hosted on our own, you could use the Woosmap Search API to achieve this. If your main goal to implement Google Places Autocomplete is to help your users find the right store for them, why not combine an autocompletion on your stores information (name and city for example) before possibly falling back to the Google Places Autocomplete. getQueryPredictions (, 150 )) Autocomplete on Stores In order to use autocomplete, you must first load the Google Places library using the libraries parameter in the bootstrap URL for the Google Maps JavaScript API. When the process finishes, Places API appears in the list of APIs on the Dashboard.ĭon’t forget to apply Application restrictions (to limit usage for the dedicated APIs - at least Places API) and API restrictions (to enable the use of this API through specific domain).

Go to the Google Cloud Platform Console.Implementing Google Places Autocomplete Enable the Places APIīefore using the Places library in the Maps JavaScript API, you must enable the Places API in the Google Cloud Platform Console. This blog post focus on the usage of this library.


Google provides a Places library through the Maps Javascript API. The service can be used to provide an autocomplete functionality for text-based geographic searches by returning places such as businesses, addresses and points of interest as a user types. The Google Places API is a service that returns places predictions using HTTP requests.
