Get maps working with a Google Maps API key
Google Maps on a Dirigible site need a Google Maps API key. Without one, or without billing turned on, the map stays blank. Once the key is in, add maps to your pages with Add locations and a store locator map.
OpenStreetMap maps work without a Google key. This guide is for when Map Provider is set to Google Maps.
Create a Google Maps API key
- Sign in to the Google Cloud Console and create or select a project.
- Open APIs & Services β Library.
- Enable Maps JavaScript API and Geocoding API.
- Open APIs & Services β Credentials.
- Click Create credentials β API key.
- Copy the key, then open it and add restrictions:
- Under application restrictions, choose HTTP referrers and add your site, for example
https://yourdomain.com/*andhttps://www.yourdomain.com/*. - Under API restrictions, allow only Maps JavaScript API and Geocoding API.
- Under application restrictions, choose HTTP referrers and add your site, for example
- Make sure the project has a billing account. Maps stay blank without billing, even with a valid key.
Google renames console buttons from time to time. If a label doesn't match, look for Library, Credentials, and API key.
Always restrict the key to your domain. Anyone can copy a map key from your site's pages, and an unrestricted key can run up charges on your account.
Add the key to your site
- Go to Appearance β Customize β Dirigible Locations.
- Turn on Enable Mapping.
- Set Map Provider to Google Maps.
- Paste the key into Google Maps API Key.
- Click Publish.
Check a page with a map in a private window. See See your latest edits (clear your browser cache).
If the GDPR Banner is on, maps can wait until the visitor accepts cookies. Write the message they see in GDPR Map Prompt, on the same Mapping panel.
Stadia and Stamen map styles use the separate Stadia API Key field, not the Google key.