Set Up Google Maps in GravityView Maps
GravityView Maps uses Google Maps to display entries on a map and convert addresses into latitude/longitude values through geocoding. To enable this functionality, you must create and configure Google Maps API keys in Google Cloud.
1. Create Google Maps API Keys
Maps Key (client-side)
Used to load and display maps to site visitors. This key is exposed in the browser.
Geocoding Key (server-side)
Used for converting addresses to coordinates. This key is not visible to users and is processed on the server.
To create keys, follow Google’s "Get API Key” instructions or watch the video below:
2. Configure API Key in Google Cloud Console
Maps Key
Required APIs |
|
Recommended restrictions |
|
Geocoding Key
Required API |
|
Recommended restrictions |
|
You can use a single API key for both displaying maps and performing geocoding. However, this requires the key to be configured without any application restrictions (no HTTP referrer restrictions and no IP address restrictions as suggested above), and it must have all three required APIs enabled:
- Maps JavaScript API
- Places API
- Geocoding API
Because the key cannot be restricted by domain or IP, and because it will be publicly visible in the browser, anyone could copy and misuse it. For this reason, using a single unrestricted key is less secure and not recommended unless you fully understand the risks.
3. Add Your Keys to GravityView Maps Settings
In your WordPress dashboard:
- Go to GravityKit → Settings → Gravity Maps
- Enter your Maps Key in the Maps Key field
- Enter your Geocoding Key in the Geocoding Key field
- Click Check Key for each field to validate API access
- Click Save Settings
4. Validate Keys
Use the Check Key button next to each field to check if they are properly configured.
Maps Key validation checks if:
- Maps JavaScript API is enabled
- Places API is enabled
- There are no restrictions are than by HTTP referrer
Geocoding Key validation checks if:
- Geocoding API is enabled
- There are no restrictions are than by IP address
5. Troubleshooting
If you see the following notice:
This page didn’t load Google Maps correctly
…it typically means Google Maps is being loaded more than once. This often happens due to your theme or another plugin also including the Maps JavaScript API. Please consult this article for more details.