Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Google Map error: InvalidKeyOrUnauthorizedURLMapError

Tags:

I am developing in JavaScript/HTML/CSS an app that uses Google Maps. I am getting the following alert dialog box:

"This page was unable to display a Google Maps element. The provided Google API key is invalid or this site is not authorized to use it. Error Code: InvalidKeyOrUnauthorizedURLMapError"

The app does actually display the map element; the alert is not a problem except it should not appear at all. The map displays properly.

I have gone in to the Google Developer's Console and, in the "Credentials" section, have "edited allowed referrers" to be mydomain.com/*

I have also gone in to the Google Developer's Console in the APIs section and enabled 11 Google Maps APIs.

like image 807
Jim Andrews Avatar asked Apr 10 '15 22:04

Jim Andrews


People also ask

How can I check if my Google map API key is valid?

To confirm the key is associated with the project: Go to the Credentials section, which can be accessed from the left side bar under Google Maps Platform > Credentials. Check that the API key you currently use on your website is listed.

How do I activate my Google Maps key?

Go to the Google Maps Platform > Credentials page. On the Credentials page, click Create credentials > API key. The API key created dialog displays your newly created API key. Click Close.


1 Answers

After lots of referrer combinations, deleting and re-creating credentials i realized that i didn't enabled "Google Maps JavaScript API". What a shame. :)

For anyone who is having trouble to get google maps api work please check if the API enabled first.

like image 151
Yarimadam Avatar answered Oct 20 '22 04:10

Yarimadam