Google 提供 API 键时地图将无法工作/此页面无法显示 Google 地图元素
Google Maps won't work when API key is provided / This page was unable to display a Google maps element
我已经使用 google 地图 API V3 一段时间了,它运行良好。昨天,我尝试将静态地图 API 添加到我的应用程序中,但我遇到了一个错误,图像要么根本不显示,要么我收到一条错误消息 'InvalidKeyOrUnauthorizedMapError',这告诉我 [= 一定有问题27=] 我一直在使用的密钥,但我在我的应用程序中使用与其他脚本相同的密钥并且它们工作正常。我仔细检查了开发人员的控制台,确保静态地图 API 已激活且密钥正确。然后我从静态图像 link 请求中删除了 api 键并且它起作用了,但我注意到我所有其他脚本,使用这个键停止工作显示这些错误:
This page was unable to display Google Maps Element
控制台显示:
UrlAuthenticationCommonError: https://developers.google.com/maps/faq#errorcodes
。
重新生成 api 密钥无效。删除密钥或使用开发者控制台中具有相同设置的不同帐户的密钥可以解决问题,但我需要它在这个帐户下以用于计费目的
TLDR; My application suddenly works only without API key or with a key from another google developer account with the exact same settings. What
may be causing the problem with this particular account?
我想这是我帐户的一些错误。我禁用并删除了所有 API 和密钥,重新启用并重新创建它们,问题已解决。
我修好了,
在控制台中说要以这种格式添加 link:
*.example.com/*
我改成了这样:
*example.com/*
成功了!
我已经使用 google 地图 API V3 一段时间了,它运行良好。昨天,我尝试将静态地图 API 添加到我的应用程序中,但我遇到了一个错误,图像要么根本不显示,要么我收到一条错误消息 'InvalidKeyOrUnauthorizedMapError',这告诉我 [= 一定有问题27=] 我一直在使用的密钥,但我在我的应用程序中使用与其他脚本相同的密钥并且它们工作正常。我仔细检查了开发人员的控制台,确保静态地图 API 已激活且密钥正确。然后我从静态图像 link 请求中删除了 api 键并且它起作用了,但我注意到我所有其他脚本,使用这个键停止工作显示这些错误:
This page was unable to display Google Maps Element
控制台显示:
UrlAuthenticationCommonError: https://developers.google.com/maps/faq#errorcodes
。
重新生成 api 密钥无效。删除密钥或使用开发者控制台中具有相同设置的不同帐户的密钥可以解决问题,但我需要它在这个帐户下以用于计费目的
TLDR; My application suddenly works only without API key or with a key from another google developer account with the exact same settings. What may be causing the problem with this particular account?
我想这是我帐户的一些错误。我禁用并删除了所有 API 和密钥,重新启用并重新创建它们,问题已解决。
我修好了,
在控制台中说要以这种格式添加 link:
*.example.com/*
我改成了这样:
*example.com/*
成功了!