Skip to content
David Cook edited this page Jan 10, 2025 · 1 revision

In order to get the map in /map working you need to set up either:

Google Maps

  1. Create an account in https://console.developers.google.com
  2. Create a new project
  3. Create a new credential (API key)
  4. Add the recently created credential the following three APIs and enable them:
  5. Add the API key to the secrets.yml of your host, as showed in the example
  6. Create a billing account. Using Google Maps is not free.
  7. Set up quotas for each API to avoid high bills.

Security

In the credentials section, Google will show an ⚠️ icon since by default there are no restrictions on the API key. This is a security issue since anybody could steal your API key from your JS code in the browser and make calls to Google possibly stealing your API calls quota.

Unfortunately, the current restrictions model doesn't allow us to use the same key for Google Maps and geocoding. So we need to keep the key without restrictions.

Open Street Maps

See here for information https://github.com/openfoodfoundation/openfoodnetwork/issues/5542