Setting up Google Maps API keys for GravityView Maps
GravityView Maps uses Google Maps to show entries on a map, to suggest addresses as people type, and to convert addresses into latitude and longitude, which is called geocoding. It needs a Maps Key and a Geocoding Key from Google Cloud, entered in the GravityView Maps settings.
Step 1: Create the API keys #
- Maps Key (client side): loads maps and address suggestions in your visitors’ browsers. Anyone who views the page’s source can see this key.
- Geocoding Key (server side): converts addresses into coordinates. It stays on your server, out of visitors’ view.
To create the keys, follow Google’s steps for a Maps JavaScript API key and for a Geocoding API key. Google’s steps start from a Google Cloud project with billing turned on.
Google’s video below shows how to create and restrict a key. The video calls the restriction for websites HTTP referrers, and Google’s current pages call it Websites.
Step 2: Set up each key in Google Cloud #
Maps Key
- APIs to enable: Maps JavaScript API and Places API
- Application restriction: Websites, with your site’s address, such as
example.com/*and*.example.com/*for a whole domain - API restrictions: Maps JavaScript API and Places API
Address suggestions need the Places API. Google made it a legacy product on March 1, 2025, and Google’s page on legacy products explains which projects can still use it.
Geocoding Key
- API to enable: Geocoding API
- Application restriction: IP addresses, with your server’s IP address
- API restriction: Geocoding API
Google’s API security best practices explain both kinds of restriction.
Google allows one type of application restriction per key. So one key can do both jobs only when it has no application restriction and has the Maps JavaScript API, the Places API, and the Geocoding API enabled.
A key with no application restriction is visible in the browser and works from any site, so anyone who copies it can use it on your account. We don’t recommend it.
Step 3: Add the keys to the GravityView Maps settings #
- In your WordPress dashboard, go to GravityKit, then Settings.
- Click GravityView Maps in the list on the left.
- Paste the Maps Key into Maps Key and the Geocoding Key into Geocoding Key.
- Click Save Settings.

Step 4: Check the keys #
Click Check Key under each key. It tests the key with Google and shows a result for each API.
For the Maps Key, it checks that:
- the Maps JavaScript API is enabled
- the Places API is enabled
- the key’s application restriction allows your site
For the Geocoding Key, it checks that:
- the Geocoding API is enabled
- the key has no Websites restriction, which a request from your server can’t meet
- the key’s IP addresses restriction allows your server
- the key’s API restrictions include the Geocoding API
A working Maps Key shows Maps JavaScript API with “This key supports loading and displaying Google Maps on your site.” and Places API with “This key is able to autocomplete addresses.” A working Geocoding Key shows Geocoding API with “This key is able to convert addresses into longitude and latitude.”
A key that Google doesn’t know shows Invalid API Key under the field, with “This key is invalid. Please verify that you entered the correct key.” and a Get a new API key link.

Troubleshooting #
| What you see | What it means |
|---|---|
| The map is dark, reads “For development purposes only,” and shows “This page can’t load Google Maps correctly.” | The Google Maps script on the page has no key, or Google found a problem with the key’s project, such as billing. A script with no key logs ApiProjectMapError in the browser’s console. When your theme or another plugin adds its own Google Maps script through WordPress, GravityView Maps uses that script in place of its own. Error: This page can’t load Google Maps correctly shows how to find and fix it. |
| There is no map, and a radius search field shows “Oops! Something went wrong.” | Google doesn’t accept the key. Click Check Key under each key, and read the error in the browser’s console, which names the reason. When the map runs on a script from your theme or another plugin, check the key in that script too. |
| The map area stays blank, with no message from Google on the page or in the console. | No Maps Key is saved in the GravityView Maps settings. |
The map stays empty, and the console shows Loader.provide not called by module 'marker'. | Google Maps is loaded twice on the page: once by GravityView Maps and once by a theme or plugin that writes its own Google Maps script tag into the page. Turn off the other copy. Error: This page can’t load Google Maps correctly shows how to find it. |
| The map loads, but entries have no markers. | My map is gray and there are no entry markers explains how to check that entries are geocoded. |