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.
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.
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.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With