Get a key for Google Maps
Create your API keys in Google Cloud and enter them in your account to enable geolocation on your website.
Available with the Essentials plan and higher.
Your own Google Maps API keys enable the geolocation features of your website:
- the map and distance search of the member directory;
- the distance search of the form search module;
- address autocomplete in public form fields, when it is enabled on the field.
You create these keys in Google Cloud, then paste them into Yapla.
A simple map on a page, for example your organization's address on the Contact us page, requires no key: embed it with the Custom content module.
Google requires a credit card to enable these APIs. Google offers a free amount of usage each month; beyond that, usage is billed to your Google Cloud account. We recommend creating a budget alert in Google Cloud under Billing > Budgets & alerts.
In this article
- Enable the APIs in Google Cloud
- Create the website key
- Create the geolocation key
- Add the keys in Yapla
Enable the APIs in Google Cloud
- Sign in to the Google Cloud console (console.cloud.google.com) with a Google account and accept the terms of service.
- Create a project, then link a billing account to it.
- Under APIs & Services > Library, enable these APIs: Maps JavaScript API, Places API, Geocoding API and Geolocation API.
Create the website key
This key displays the map and address autocomplete in your visitors' browser.
- Under APIs & Services > Credentials, click Create credentials > API key.
- Open the key to restrict it. Under Application restrictions, choose Websites.
- Add all your website's addresses: the Yapla address and, if you have one, your domain name. End each address with /* to cover all pages, for example https://my-organization.org/*.
- Save.
Create the geolocation key
This second key is used by Yapla's servers to convert addresses into coordinates and calculate distances.
- Under Credentials, create a new API key.
- Under Application restrictions, choose IP addresses, then add the addresses of Yapla's servers:
- 99.79.153.179
- 99.79.159.163
- 52.212.157.23
- 52.212.170.179
- 52.60.140.239
- Under API restrictions, limit the key to Places API, Geocoding API and Geolocation API.
- Save.
Add the keys in Yapla
You can enter the keys for your whole account or for a single website.
- For the whole account: go to Settings > External tools.
- For one website: go to Website, open the website, then click the External tools tile. Keys entered here replace the account keys for that website.
Then paste:
- the website key in the API Key field of the Google Maps section;
- the geolocation key in the API Key field of the Google Places and Google Geo sections.
Fill in all three fields: the map and distance search work only when the Google Maps, Google Places and Google Geo keys are all entered.
Save. A new key can take a few minutes to work. If the map still shows an error after 15 minutes, check in Google Cloud that the key is active and that its restrictions contain the right addresses.
