Locatoraid

WordPress Store Locator Plugin

Enable Geocoding API

Locatoraid makes use of Google Maps and the Google Maps Platform requires the usage of API keys and an active billing account.

Also you will need to enable a certain set of Google Map APIs to power up certain functions of our store locator plugin. For example, to make the locator find coordinates by the entered address, we need to enable Google Maps Geocoding API.

Problem

When using the search bar to search for a zip code or an address, the search hangs, the spinning ball just keeps going.

Solution

If you open up the JavaScript console of the browser (press Ctl+Shift+J in Chrome or Ctl+Shift+K in Firefox), there will be an error like this:

Geocoding Service: This API project is not authorized to use this API. For more information on authentication and Google Maps JavaScript API services please see: https://developers.google.com/maps/documentation/javascript/get-api-key

This error means that you need to enable Geocoding API for your Google maps key which makes possible finding locations by their address string. To enable it, please do the following in your Google Cloud control panel:

Once you finish configuring Google Maps Geocoding API, the store locator plugin will be able to handle your visitors search input. When a visitor enters some address, we find the coordinates of this search, then look through your locations to match those closest to these coordinates.