Skip to main content

Google Maps

This page provides instructions to integrate Google Maps to use the Map Widget in your applications on the self-hosted instance.

Prerequisites

Generate Google Maps API key

  1. Log into the Google Cloud console.
  2. Generate a Google Maps API key. Follow the Create API keys guide on the official Google Maps platform documentation.
  3. Restrict the Google Maps API key. Follow the Restrict API keys guide on the official Google Maps platform documentation.
  4. Ensure that you've enabled Maps Embed API, Maps JavaScript API, Places API, and Geolocation API when following the Restrict API keys guide on the official Google Maps platform.

Configure Google Maps on Appsmith

You can add the API key in one of the below ways:

Admin Settings

Attention

If you have assigned the API key value using an environment variable for your instance, it takes precedence over the value provided through the Admin Settings UI.

Follow these steps to add the API key to your self-hosted instance using Admin Settings:

  1. Log into your Appsmith instance as a superuser.

  2. Go to Admin Settings screen.

  3. Select Google Maps from the left nav bar.

Google Maps API Key.
Add your Google Maps API Key
  1. Add your API key to the Google Maps API Key field.

  2. Click the SAVE & RESTART button to restart the instance.

Environment variable

Follow these steps to add the API key to your self-hosted instance using an environment variable:

  1. Go to the location where the Appsmith configuration file is located. For example, the docker.env file for Docker and the values.yaml file for Kubernetes.

  2. Update the value of the APPSMITH_GOOGLE_MAPS_API_KEY variable as shown below:

# Google Maps API key
APPSMITH_GOOGLE_MAPS_API_KEY=<YOUR_API_KEY>
  1. Restart the instance.

You're all set to use the Map widget in your Appsmith applications.

Troubleshooting

If you face issues, contact the support team using the chat widget at the bottom right of this page.