Appendix C – Setup Google Maps API
The World Clock and Meeting Planner components use the Google Maps Platform to get time zone information. In order to use this platform, you need a Google Maps API Key. This document describes how to create this key for your organization.
Pre-requisite
It is assumed that you have installed Local Time App version v2.27 or later in your sandbox and production environments. You can install the latest version of the App from this link.
Process
- Create a project from Google Cloud Console
- Enable the relevant APIs
- Create the API Key
- Update the Local Time App
1. Create a project from Google Cloud Console
Login to Google Cloud Console. Click Create Project to begin creating a new Cloud project. If you already created a project before, you can decide to re-use this project instead of creating a new one.
Make sure that billing is enabled for your Cloud project. From the Navigation Menu located in the top left corner, select the Billing menu option. Then select the Payment settings and Payment method sub-menus to setup your payment profile and credit card respectively.
2. Enable the relevant APIs
From the Navigation Menu located in the top left corner, select the APIs & Services menu option and click Enable APIs and Services. Search and add the following APIs.
- Places API
- Time Zone API (Note: this might be automatically added when you added the Places API)
When you have added the APIs the Console may automatically create an API Key and you might see a prompt like the following screenshot.
In this case, accept the API Key and click Go To Google Platform button. You might see another prompt to restrict the API Key. Select the two APIs (Places API and Time Zone API) and setup the restrictions as shown below.
3. Create the API Key
If the API Key creation prompt did not appear in the prior steps, select the Navigation Menu located in the top left corner, and then select the Credentials sub menu. Click Create Credentials and then select the API key option. The API Key is then created automatically.
Select the Actions option for this API Key and click Edit API key.
Ensure that the key is restricted as shown below and click the Save button to update your restrictions.
4. Update the Local Time App
You have now completed the steps to create the API Key. In Salesforce, from the Local Time Config tab, copy the API Key in the Google Maps API Key field and click the Save button to update the settings. The World Clock and the Meeting Planner lightning components in Salesforce should start working as expected.