Google Maps API

Step 1: Set Up a Google Cloud Project

  1. Go to the Google Cloud Console: Google Cloud Console.

  2. Create a new project:

    • Click the Select a project dropdown at the top.

    • Click New Project.

    • Provide a Project Name, choose an organization (if applicable), and click Create.

    • Once the project is created, select it from the project dropdown.


Step 2: Enable Google Maps API Services

  1. Enable APIs:

    • In the Google Cloud Console, click the Navigation Menu (three horizontal lines in the top left).

    • Go to APIs & Services > Library.

    • Search for Maps SDK for Android (for Android apps) and Maps JavaScript API (for Web apps).

    • Click on each API and then click Enable to activate it for your project.


Step 3: Generate API Key

  1. Create API key:

    • After enabling the APIs, go to APIs & Services > Credentials.

    • Click + Create Credentials > API Key.

    • Google will generate an API key for you.

  2. Restrict API Key (Recommended):

    • After generating the key, click on the API key to edit.

    • Under API restrictions, select the Maps SDK for Android (for Android) or Maps JavaScript API (for Web).

    • Under Application restrictions, select the relevant option:

      • For Android: Select Android apps and provide the SHA-1 fingerprint and package name.

      • For Web: Select HTTP referrers (websites) and enter the domain(s) where the API key will be used.

    • Click Save.

Last updated