新生成的 API 密钥上的 ExpiredKeyMapError [英] ExpiredKeyMapError on newly generated API key
问题描述
我刚刚生成了一个 API 密钥,使我们能够在我们的网站上显示 Google 地图,但我收到了 ExpiredKeyMapError.这与 8 个月前的 stackoverflow 查询完全相同,但从未收到解决方案:Google Maps ExpiredKeyMapError 与最近创建的 API Key
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:
抱歉!出了点问题.此页面未加载 Google 地图正确.有关技术详细信息,请参阅 JavaScript 控制台"
"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 错误:ExpiredKeyMapErrorhttps://developers.google.com/maps/documentation/javascript/error-messages#expired-key-map-error
SCRIPT12008:WebSocket 错误:HTTP 响应不正确.状态码403,禁止
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.
推荐答案
我在生成新的 API 密钥后遇到了同样的错误,但我已经启用了 JavaScript API 并且一切都正确设置.
I had the same error after generating a new API key, but I had JavaScript API already enabled and everything correctly setup.
在寻找答案并检查我还能做什么时,钥匙开始起作用了.因此,每次创建新密钥时,请耐心等待,并希望它在 1-8 分钟内生效.
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.
这篇关于新生成的 API 密钥上的 ExpiredKeyMapError的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!