MapKey Creation & Restriction Guide
1.Overview
This guide provides step-by-step instructions to create a Google Maps API key, enable necessary APIs, and set restrictions for secure usage.
2.Create a MapKey
- Go to Google Cloud Console.
- Navigate to
Menu → Billing
and link a billing account.- If billing is not enabled, add a billing account first, then enable it.
- Go to
APIs & Services → Library
and enable the following APIs:- Mandatory: Maps SDK for Android, Maps SDK for iOS, Maps JavaScript API, Places API (New), Routes API, Geolocation API, Geocoding API, Cloud Translation API.
- Optional: Directions API, Distance Matrix API, Places API (Legacy).
- Once all required APIs are enabled, go to
APIs & Services → Credentials → Create Credentials → API Key
. - Your API key is now created.
3.Restrict the MapKey
- Go to
Edit API Key
. - Under Application restrictions, select one of the following:
- Android apps: Add package name and SHA1 key.
- iOS apps: Add bundle ID.
- IP addresses: Add allowed IP addresses.
- Websites: Add allowed website URLs.
- Under API restrictions, select
Restrict key
and choose APIs according to restriction type:- Android: Geocoding API, Geolocation API, Maps SDK for Android, Routes API, Places API (New).
- iOS: Geocoding API, Geolocation API, Maps SDK for iOS, Routes API, Places API (New).
- Website / IP address: Geocoding API, Geolocation API, Maps JavaScript API, Routes API, Places API (New), Cloud Translation API.
- Save your changes.