When is the Google Maps API Key required?

Google recently changed its policy to use API keys. Now you no longer need an API key to host Google Maps on your website.

And it worked perfectly. But now I have this card (without an API key), working on my localhost, which works fine. But as soon as I post it on the Internet, I get a pop-up message stating that I need one more API key. And on another page of this website, Google Maps really works. Maybe this may be due to the fact that on a card that does not work, there are many (30+) markers on it?

In fact, using an API key would not be a very good solution for me, as it is part of the Wordpress plugin used on many websites.

+7
source share
2 answers

It looks like you are using v2 ~ time to update or get the key for the domain in which you want to run it: Request for the Google Maps API V2 key

+6
source

You do not need an API key to use the Goolge Maps V3 APIs. However, we just ran into a problem when Google reported that we exceeded our limit, although we did not (Development Server). I went ahead and set up the API key, and this is really useful because you then get a usage report. In addition, since then we have not seen the problem of using a false quota. I thought I would continue the process:

Go to https://console.developers.google.com/

Click the red Create Project button

Give your project a name and Google will automatically provide it with an identifier

Wait until Spinny at the bottom informs you that your project is completed.

In the left navigation bar, select API API and Auth and select "Google Maps JavaScript API v3"

enter image description here

Click the link and then enable the API

enter image description here

enter image description here

Go to the credentials in the API and Auth section and click the red "Create a new key" in the "Open API" section. Then click the Browser Key button.

enter image description here

Make sure you include an asterisk in the name of your site. For example, use mywebsite.com/*. This ensures that all pages are allowed to use the API.

Copy the key into the Javascript link on the Google Maps API, for example:

<script type="text/javascript" src="https://maps.googleapis.com/maps/api/js?key=YOUR_KEY"></script> 

enter image description here

In short, a key is not required, but best practices mean that you must use a key.

+6
source

All Articles