In order to make use of geolocation functionality in Humanforce, such as geotagging and geofencing for clocking, a Google Maps API key is required.
Google Maps allows for a specific number of free requests per website which will cover the usage requirements of most clients. For more information on the number of free requests and pricing options please see the Google Maps Pricing and Plans page.
The following details how to obtain a Google Maps API key and apply it to Humanforce in order to make use of these features:
Obtain an API Key from Google Maps
To get a Google Maps API key you must first have a Google Account and be signed in to that account. You can create a new Google Account here if required.
1. Once you are signed in to your Google Account, go to the Google Developer Console to create your maps API key.
2. After agreeing to the TOS, select the option to Create a project. The project will be called "My Project" by default, however, this can be changed without issue. Press Continue.
3. In the menu on the left, select Credentials. Then click + CREATE CREDENTIALS on the top and choose API key.
4. An API key is created.
- If you wish to give it a name and restrict its use to your Humanforce URL, choose Restrict Key and go to step 5.
- If you are happy with an un-restricted key named API key 1, click Close
- Restricting a key will allow you to only use it for a specific domain (humanforce.com), un-restricted keys can be used everywhere you implement them.
5. If you have multiple API keys it may be a good idea to name them properly. Here you can restrict the API key. Click Save when finished.
6. Your API Key will then be listed under the Credentials API Keys section. It can be accessed again and have restrictions updated at any time through the credentials section of the Google Developers Console. You may wish to copy this key now and save in a notepad or other location while you complete the next steps.
Add Billing Details to Google APIs
Even if your use of the Google Maps API is within the free usage quota, billing details are still required to be set up in the Google Developer Console.
- Press the Menu button in the top left of the Google developer console and select the Billing menu option.
- Select Create Billing Account when prompted and follow further prompts to complete the billing account configuration.
Enable the correct APIs
1. Back in the Menu button for the Developer Console, go to Google Maps > APIs.
2. Make sure the following APIs are all in the Enabled API list (scroll down to find them all):
- Geocoding API
- Geolocation API
- Maps JavaScript API
- Maps Static API
- Places API
Add the API Key to Humanforce
1. Go to the Admin section of Humanforce.
2. Under Administration Configuration select System Settings.
3. Under the General tab, enter your API key (that you copied earlier, otherwise you can find it again in the Credentials section of the developer console) into the Google Maps API Key field. Scroll to the bottom of the page and click Save Changes.