If you are self-hosting the Specify Web Portal, you need to create a new Google Maps API key to gain access to the full coordinate mapping experience.
1. Create or update the Google Cloud key
In the Google Cloud project associated with the portal:
-
Enable billing.
-
Enable the Maps JavaScript API.
-
Create an API key, or update the existing key.
-
Under Application restrictions, choose Websites and allow your portal URL, for example:
https://your-portal.example.org/*
Keep the key restricted to the domains that host your portals.
2. Update the Web Portal source
Edit this file in the webportal-installer checkout:
PortalApp/index.html
Replace the value in the Google Maps script tag:
<script src="//maps.googleapis.com/maps/api/js?key=YOUR_NEW_KEY&sensor=false"></script>
3. Rebuild the generated portal files
If the portal runs in Docker, run the build inside the container so the mounted custom settings are used:
docker exec webportal make clean-html
docker exec webportal make build-html
This rebuilds all hosted portals from PortalApp and reapplies each portal’s custom settings. A Docker image rebuild or container restart is normally not required.
For a single portal, you can use its collection name:
docker exec webportal make clean-SLUG-html
docker exec webportal make build/html/SLUG
Replace SLUG with the portal directory name.
4. Verify
Open the portal in a private/incognito window and select Map. If the map still fails, check the browser console for:
BillingNotEnabledMapError: enable billing for the key’s Google Cloud project.RefererNotAllowedMapError: add the portal URL to the key’s website restrictions.ApiNotActivatedMapError: enable the Maps JavaScript API.
If you have any questions, feel free to reach out to us on this forum or via support@specifysoftware.org!