Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

When is a Google Maps API key required?

Recently Google changed it's policy on the use API keys. You're now supposed to no longer need an API key to place Google Maps on your website.

And this worked perfectly. But now I have this map (without API key) running on my localhost, which works fine. But as soon as I place it online, I get a popup saying that I need another API key. And on another page on that website, Google Maps does work. Could it maybe have something to do with that the map that doesn't work have a lot (30+) of markers on it?

Actually using an API key wouldn't be a very nice solution to me, as this is part of a Wordpress plugin used on many websites.

like image 656
Thomas Avatar asked Feb 26 '11 16:02

Thomas


2 Answers

Sounds like you're running v2~ time to upgrade, or get a key for the domain you want to run it on: Google Maps V2 API Key Request

like image 76
Shad Avatar answered Sep 18 '22 16:09

Shad


You do not need an API Key to use Goolge Maps API V3. However, we just experienced an issue where Google reported that we had exceeded our limit, even though we didn't (Development Server). I went ahead and set up an API Key, and its actually beneficial, because you then get usage reporting. Also, we haven't seen the false Quota usage problem since then. I thought I would go ahead a share the process:

Goto https://console.developers.google.com/

Click the red 'Create Project' button

Give your project a name and Google will automatically give it an ID

Wait until the Spinny on the bottom says your project is complete.

In the left hand nav, select APIs Under APIs & Auth, and select 'Google Maps JavaScript API v3'

enter image description here

Click the link and then Turn on the API

enter image description here

enter image description here

Go to Credentials under the APIs & Auth section, and click the red 'Create New Key' under the Public API access section. Then click Browser Key.

enter image description here

Make sure you include the star in your Website's name. For example, use mywebsite.com/*. This will ensure all pages are authorized to use the API.

Copy the key into your Javascript reference to the Google Maps API, like so:

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

enter image description here

Long story short, the key is not required, but best practices would indicate that you should use the key.

like image 25
Mr. B Avatar answered Sep 22 '22 16:09

Mr. B