🔑

Obtaining Your Maps API Key(s)

🏡 Home 📖 Chapter 👉 Next
⚡  GMapsBook.com is crafted by Jozef Sorocin and powered by:
  • g-Xperts (Google Cloud & Business Profile Partner)
 
 
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)
Each of these keys should have its own restrictions as discussed below. Also note that the whole project is associated with at most one billing account.

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):
  1. Visit console.cloud.google.com
  1. Click on the "Select a Project" dropdown in the top navbar and then click on "New Project".
  1. Give your project a name and click "Create".
  1. Wait for the project to be created. This may take a few minutes.
  1. 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

  1. In the Google Cloud Platform console, select your project from the dropdown in the top navigation bar.
  1. Click on the hamburger menu in the top-left corner and select "APIs & Services" > "Dashboard".
  1. Click on "Enable APIs and Services".
  1. Search for "Maps Javascript API" and click on it.
  1. Click the "Enable" button.

Already purchased? Sign in here.