Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ExpiredKeyMapError on newly generated API key

Tags:

I have just generated an API Key to enable us to display a Google map on our website but I'm getting the ExpiredKeyMapError. This is the exact same issue as this stackoverflow query from 8 months ago, but that has never received a solution: Google Maps ExpiredKeyMapError with recently created API Key

When the page first loads, the map shows for a split second and then it disappears, to be replaced with a grey box that says:

"Sorry! Something went wrong. This page didn't load Google Maps correctly. See the JavaScript console for technical details"

And when I pull up the console, this is the error message I get:

Google Maps API error: ExpiredKeyMapError https://developers.google.com/maps/documentation/javascript/error-messages#expired-key-map-error
SCRIPT12008: WebSocket Error: Incorrect HTTP response. Status code 403, Forbidden

and that last line just keeps repeating.

Any help much appreciated because I have no idea how to solve this myself.

like image 446
Heather McRae Avatar asked Oct 04 '17 08:10

Heather McRae


People also ask

Why is my Google Maps API key not working?

There are a several reasons why your google maps may not be working, the most common issue being no Google Map API key set or set incorrectly. To use the Google Maps JavaScript API, you must register your app project on the Google Cloud Platform Console and get a Google API key which you can add to your app.


2 Answers

I had the same error after generating a new API key, but I had JavaScript API already enabled and everything correctly setup.

While searching for an answer and checking what else I can do, the key started to work. So every single time you create a new key, be patient and expect it to work within 1-8 minutes.

like image 176
Lukas Avatar answered Oct 03 '22 15:10

Lukas


I discovered that it was not working because I hadn't separately enabled the Google maps javascript API. Once I'd done that, the map started working a few minutes later.

like image 44
Heather McRae Avatar answered Oct 03 '22 16:10

Heather McRae