Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Google Maps API warning: NoApiKeys

I've been using Google Maps API v3 for some time without an API key, and it worked well.
It still works, but I get a warning in the console:

Google Maps API warning: NoApiKeys https://developers.google.com/maps/documentation/javascript/error-messages#no-api-keys

I include the script the standard way:

<script src="https://maps.googleapis.com/maps/api/js?libraries=places"></script> 

And google.maps.version indicates that I'm using 3.24.2.

In the Google documentation I can only see the different ways to obtain a key, but there is no indication if it's required or not. I noticed the warning today and I'm quite sure it didn't appear a few weeks ago.

Everything is working fine for now, but I'm afraid that maps access without an API key will be ceased in the future. I'm reluctant to register for a key if I don't absolutely need to.

Should I worry about it?

like image 644
Tamás Sallai Avatar asked Mar 09 '16 11:03

Tamás Sallai


People also ask

How do I get rid of this page Cannot load Google Maps correctly?

You can do that by accessing Application restrictions, then navigate to “HTTP referrers” then type in your domain's name. After making the necessary changes, click Save. Copy the API key because you will need it to get the map back on your website.


Video Answer


2 Answers

Creating and using the key is the way to go. The usage is free until your application reaches 25.000 calls per day on 90 consecutive days.

BTW.: In the google Developer documentation it says you shall add the api key as option {key:yourKey} when calling the API to create new instances. This however doesn't shush the console warning. You have to add the key as a parameter when including the api.

<script src="https://maps.googleapis.com/maps/api/js?key=yourKEYhere"></script> 

Get the key here: GoogleApiKey Generation site

like image 69
Max Avatar answered Nov 16 '22 21:11

Max


A key currently still is not required ("required" in the meaning "it will not work without"), but I think there is a good reason for the warning.

But in the documentation you may read now : "All JavaScript API applications require authentication."

I'm sure that it's planned for the future , that Javascript API Applications will not work without a key(as it has been in V2).

You better use a key when you want to be sure that your application will still work in 1 or 2 years.

like image 24
Dr.Molle Avatar answered Nov 16 '22 21:11

Dr.Molle