ā”Ā GMapsBook.com is crafted by Jozef Sorocin (š¢Ā Book a consulting hour) and powered by:
- g-Xperts (Google Cloud & Business Profile Partner)
- Spatialized.io (Elasticsearch & Google Maps consulting).
- and Garages-Near-Me.com (Effortless parking across Germany)
Ā
Use caseApproachAccount, Project, Billing AccountGenerating a Maps API keyProgrammatically creating a Maps API keyEnabling the APIsProtecting the API key(s)API RestrictionsHTTP Referrers
Ā
The Maps Platform runs on the Google Cloud Platform (GCP).
Roughly speaking, GCP is Googleās answer to Amazonās AWS and Microsoftās Azure.
But in terms of geospatial tooling, nothing comes close to Googleās extensive offering.
Now, even if you only intend to use GCPās map-related features, youāll still need:
- a GCP account
- a GCP billing account
- a GCP project
- and a GCP Maps Key.
Thatās a bunch of new terms so letās visualize a typical, moderately complex scenario which will help us understand the moving parts.
Use case
I have a web application consisting of a frontend and a backend. I need two separate API keys ā one to display a map on the frontend and another to run geospatial workloads from the backend.
Approach
From GCPās point of view, the hierarchical architecture for the above scenario looks as follows:
ā³ (user) account
ā³ billing account
ā³ project A
ā³ Frontend API key
ā³ Backend API key
ā³ Development/testing key (optional)
Account, Project, Billing Account
Assuming you already have a google account (e.g. a @gmail.com email or a company email running on Google Workspace):
- Visit console.cloud.google.com
- Click on the "Select a Project" dropdown in the top navbar and then click on "New Project".
- Give your project a name and click "Create".
- Wait for the project to be created. This may take a few minutes.
- If you donāt have a billing account, youāll be prompted to create one. FYI, almost every new billing account gets $200 USD of monthly credit towards Maps usage.
Ā
Generating a Maps API key
- In the Google Cloud Platform console, select your project from the dropdown in the top navigation bar.
- Click on the hamburger menu in the top-left corner and select "APIs & Services" > "Dashboard".
- Click on "Enable APIs and Services".
- Search for "Maps Javascript API" and click on it.
- Click the "Enable" button.