Store Locator with Autocomplete
This lesson will help you to setup
- The google maps and places api key needed for the autocomplete functionality
- Show you how to use the store locator shortcode with autocomplete along with restricting searches to a country.
We need to enable Google Maps and Places in the API key.
Google Maps API helps to authenticate the google maps rendering request on your website.
Places API authenticates the search autocomplete suggestions request.
This happens when you search for locations in store locator form.
Google no longer supports keyless access for Google Maps Platform API. Hence you have to use an API Key in your website.
Enable Google Maps and Places API
Follow these steps to get the API Key:
- Visit the Google Cloud Platform Console Dashboard page.
- Create or select a project.
- Please make sure that the top bar has the correct project selected.
- Click on the ENABLE APIS AND SERVICES link.
- To enable Places API, search for Places API in the Search for APIs and Services searchbox.
- Click on the Places API item in the search results.
- On the Places API’s details page you will have an option to ENABLE the API.
- Visit the project’s dashboard and select Credentials in the left column.
- Click Create Credentials and select API key if you don’t have one.
- Once you complete the process, you will find an API key on the same page.
Yoast Local SEO Toolkit
Get the most out of Yoast Local SEO plugin by using the Divi Builder for your location pages.