Sunday, 14 June 2015

google places autocomplete js api business search doesn't work

If Google Places Autocomplete doesn't show business search results, you may solve the issue by following the checks below.

Check whether google places API has been activated

Go to google console with the URL of https://console.developers.google.com, and check whether google places service is in the list of activated services

Check the whether google client auth is included in the js code

Usually a google url like https://apis.google.com/js/client.js?onload=handleClientLoad will be the html scripts if the google client has been set up in your code.
Compare the APIKey in you js code with that in google console to make sure they are the same

Check the types attribute of Google Places Autocomplete API

When instantiating the google places autocomplete object, the types can be passed as a parameter. So check the types value to see whether it's including 'establishment' type.
The types can also be set up by calling the setTypes method of Autocomplete, so we need to check the types here as well.

After all of the checks and modifications, the business search should work if everything has been done properly.

No comments:

Post a Comment