If you click on your Maps link in Salesforce and receive the following message from Google, "The Google Maps Platform server rejected your request. You must use an API key to authenticate each request to Google Maps Platform APIs..." You need to register a billing account with Google and obtain an API key in order to continue using the Google Maps API. In addition to the $200 free usage monthly, you get a $300 credit when you start your free trial, so you can monitor your usage and decide whether to continue displaying maps in Salesforce. According to this pricing table, you can load static maps 100,000 times a month at no cost*.
"When you enable billing, you will get $200 free usage every month for Maps, Routes, or Places. Based on the millions of users using our APIs today, most of them can continue to use Google Maps Platform for free with this credit. Having a billing account helps us understand our developers’ needs better and allows you to scale seamlessly.
To avoid a service interruption to your projects, please visit our Get Started page to create a project, generate an API key, and enable a billing account. Once you generate and obtain an API key, make sure to update your application with the new API key."
*Note: these prices are subject to change, please validate with Google regarding the latest pricing and promotions.
- Click the Get Started link.
- Select Maps.
- Click Continue.
- Create a new project.
- Click Next.
- Click Create Billing Account.
- Select Country.
- Check that you read the Terms of Service.
- Click Agree and Continue.
- Enter you address and payment information and click Start my free trial.
- Click Next to enable the Google Maps Platform.
- Make sure that "Map Static API" is enabled.
- Copy your API Key.
- Go to the Map Link field on the object you're rendering maps on and click Edit.
- If your API key was AAAA, you would insert "key=AAAA&" between "staticmap?" and "center=" resulting in a formula like this:
- "http://maps.googleapis.com/maps/api/staticmap?key=AAAA¢er=" & TEXT( GPS_Coordinates__Latitude__s ) & "," & TEXT( GPS_Coordinates__Longitude__s ) & "&zoom=12&size=300x300&sensor=true&markers=color:red%7Clabel:A%7C"& TEXT(GPS_Coordinates__Latitude__s ) & "," & TEXT(GPS_Coordinates__Longitude__s )
- Click Save.
- Repeat steps 13 and 14 for all Map link fields.