Google Maps
Every map in JoomMap is a Google map, loaded with the Google Maps JavaScript API. It is used for the map pages, the location pages, both modules and the GeoCoder tool in the administrator and the site form. JoomMap needs an API key for it.
What you need
- A Google account and a Google Cloud project with a billing account. Google bills map loads by use and gives a monthly amount of free use. Check the current prices on Google's pricing page.
- An API key with the Maps JavaScript API enabled.
- For the GeoCoder tool and the map search, also Google Geocoding. For directions, also Google Directions.
Get an API key
- Go to the Google Cloud Console (
console.cloud.google.com) and create a project, or choose an existing one. - Set up billing for the project.
- Under APIs & Services > Library, enable the Maps JavaScript API, and the Geocoding API if you will use the GeoCoder tool or the map search.
- Under APIs & Services > Credentials, click Create credentials > API key.
- Restrict the key:
- Application restrictions: Websites, and add your site, for example
https://www.example.com/*. Add your development site too if you have one. - API restrictions: choose the APIs you enabled.
- Application restrictions: Websites, and add your site, for example
- Copy the key.
Enter the key in JoomMap
- Open Components > JoomMap > Options.
- On the Google API tab, paste the key into Google Maps API Key.
- Optionally choose a Region, for example Morocco. Google Maps then shows borders and labels as seen from that country, and geocoding prefers results there.
- Click Save & Close.
The red warning on the dashboard disappears, and the maps load.
Map settings
The map type, zoom, controls and size are set on the Map / Display tab of the options, and per map in its Advanced Parameters. Colours are set with Map styles.
Privacy
Every page with a JoomMap map loads scripts and map tiles from Google, which sends the visitor's IP address to Google. If your site needs consent before loading outside services, cover Google Maps in your cookie or consent solution and mention it in your privacy policy.
When the map does not load
- A grey box with "This page can't load Google Maps correctly" means Google refused the key. Check that the key is correct, billing is active, the Maps JavaScript API is enabled and your site's address is in the key's website restrictions.
- Open the browser console (F12). Google writes the exact reason there, for example
RefererNotAllowedMapErrororApiNotActivatedMapError.
See also Troubleshooting.