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 → Billingand link a billing account.- If billing is not enabled, add a billing account first, then enable it.
- Go to
APIs & Services → Libraryand 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 keyand 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.
- Google Map Keys and their restrictions are as follows
Map Keys Application Restriction API Restriction Admin Panel Key (Javascript) Website ( Server Domain ) Geocoding API, Geolocation API, Maps JavaScript API, Routes API, Places API (New) Admin Panel Key (MyRoute) IP Addresses (Server IP Addresses [IPv4/IPv6 - IPv6 if IPv6 defined]) Cloud Translation API, Routes API Android Key Android apps ( add package name and SHA-1 [debug, release, Play Console] ) Maps SDK for Android, Places API (New), Geocoding API, Geolocation API, Routes API, Directions API IOS Key IOS apps ( add iOS bundle identifier [e.g., com.yourcompany.taxiapp]) Maps SDK for IOS, Places API (New), Geocoding API, Geolocation API, Routes API, Directions API
