Set up Google Map key in Google Cloud Console.

May 20, 2024 0 Comments UNCATEGORIZED
Blog image

To use Google Maps Platform, you must have a project to manage services, credentials, billing, APIs, and SDKs. Billing setup is required for each project, but you will only be charged if a project exceeds its quota of no-charge services.

Log into Google Cloud Console here.

On the New Project page, fill in the required information:

  • Project name: Accept the default or enter a customized name. You can change the project name at any time. For more information, see Identifying projects.
  • Project ID: Accept the default or click EDIT to enter a customized ID that Google APIs use as a unique identifier for your project. After you create the project, you cannot change the project ID, so choose an ID that you’ll be comfortable using for the lifetime of the project. Don’t include any sensitive information in your project ID.
  • Billing account: Select a billing account for the project. If you haven’t set up a billing account or only have one billing account, you won’t see this option. You must be a Billing Account Administrator or Project Billing Manager to associate a project with a billing account. For more information, see the billing access control documentation.
  • Location: If you have an organization you want to link your project to, click Browse and select it; otherwise, choose “No organization”.

To deploy your apps, you must enable billing. Your account will not be charged if you stay within your monthly quota. If your application needs resources that exceed the monthly quota, you will be charged for the additional usage.

If you have a billing account when you create a Cloud project, then billing is automatically enabled on that project.

To enable billing on a Cloud project:

  1. In the Cloud Console, go to the Billing page:
    Go to the Billing page
  2. Select or create a Cloud project.
  3. Depending on if a billing account exists or if the selected Cloud project is associated with an account, the Billing page displays one of the following:
    • If billing is already enabled for the selected Cloud project, then the details about the billing account are listed.
    • If no billing account exists, you are prompted to create a billing account and associate it with the selected Cloud project.
    • If a billing account exists, you are prompted to enable billing if the selected Cloud project is not already associated with a billing account. You can also select Cancel and then select Create account to create and associate a new billing account.

After you enable billing, there is no limit to the amount that you might be charged. To gain more control over your costs, you can create a budget and set alerts. For more information, see Billing.

To use Google Maps Platform, you must enable the APIs or SDKs you plan to use with your project. For Google maps. Go to libraries and enable Maps Javascript API, Places API, Roads API & Directions API.

Create an API key for Google Maps

In the Google Cloud console, go to the Credentials page: Go to Credentials

  1. Click Create credentials, then select API key from the menu. The API key created dialog displays the string for your newly created key.

Copy your key string and keep it secure. Unless you’re using a testing key that you intend to delete later, add application and API key restrictions.

Secure an API key for Google Maps

When you use API keys in your applications, ensure that they are kept secure during both storage and transmission. Publicly exposing your API keys can lead to unexpected charges on your account. To help keep your API keys secure, follow these best practices:

  • Add API key restrictions to your key. By adding restrictions, you can limit the ways an API key can be used, reducing the impact of a compromised API key.
  • Delete unneeded API keys to minimize exposure to attacks.
  • Recreate your API keys periodically. Periodically create new API keys, delete the old keys, and update your applications to use the new API keys.

Apply API key restrictions

API keys are unrestricted by default. Unrestricted keys are insecure because they can be used by anyone from anywhere. For production applications, you should set both application restrictions and API restrictions.

To restrict your API Please choose a website and add your valid url and select restrict key.

Tick all APIS that are relevant including the 4 you just enabled and press save.

If you have created the key correctly a green tick will appear beside your API key.

0 0 votes
Article Rating
Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments
Recent Posts