Google Maps
By default AdventureLog uses OpenStreetMap to search for places and look up addresses. With a Google Maps API key, it uses Google instead for place search, place details, recommendations, and addresses.
Who sets it up: the server admin, once, for everyone on the server. Users see it as on or off under Settings → Integrations.
Create an API key
- Go to the Google Cloud Console and sign in, or create an account.
- Open the project dropdown in the top bar, choose New Project, name it (for example
AdventureLog Maps), and choose Create. Make sure the new project is selected. - Open the navigation menu and go to Google Maps Platform. Google may ask you to link a billing account, even if your usage stays within the free monthly usage. See Costs.
- Go to APIs & Services, filter products by Places and tiers by Essentials, and enable the Geocoding API and the Places API (New).
- Go to Keys & Credentials, choose Create credentials → API key, and copy the key.
- Restrict the key to the Geocoding API and the Places API (New). See Securing the API key.
Server setup
Add the key to your env file (.env for Standard Deployment, .env.advanced for Advanced, where it belongs to the backend server service), then restart:
GOOGLE_MAPS_API_KEY=your_api_keyWhat AdventureLog uses Google for
| Feature | Google API method |
|---|---|
| Searching for a place when adding a location | Places API (New): Text Search |
| Details of a selected place | Places API (New): Place Details |
| Recommendations near a location | Places API (New): Nearby Search |
| Turning coordinates into an address | Geocoding API, plus a Places API (New) Nearby Search for the place name |
| Photos shown with search results and recommendations | Places API (New): Place Photos |
Securing the API key
The key stays on your server. Search, recommendations and photos all go through AdventureLog's backend, so the key is never sent to a browser. Photos are fetched by the server and only signed-in users can request them. Still, restrict the key so it is useless if it leaks.
Edit the key under Keys & Credentials and set:
- APIs: restrict the key to the Geocoding API and the Places API (New).
- Application: restrict the key to the public IP address of your server. Every request comes from there, so this works for all users.
Costs
Google Maps Platform bills each API method per request, with free usage each month per API method. See Google Maps Platform pricing for current free limits and prices for the Essentials APIs.
Capping usage
To put a hard limit on usage, lower the per-day quotas. This is only possible after the free trial has finished.
- In the Google Cloud Console, go to Google Maps Platform → Quotas.
- Select the API.
- Tick the box next to a per-day quota, click Edit, enter a new value and submit.
To stay within the free monthly usage, divide it by 31: for example, 32 per day for SearchTextRequest, GetPlaceRequest, SearchNearbyRequest and GetPhotoMediaRequest. Do the same for the Geocoding API (322 per day). When a quota is reached, Google refuses further requests until midnight Pacific Time.
Troubleshooting
If the backend logs show Google recommendations provider error: Google Places API error, or search falls back to OpenStreetMap results, check that the Places API (New) is enabled for your project and allowed in the key's API restrictions.
