Google 静态地图无法使用 Google API 控制台生成的密钥
我使用的是 Google 静态地图 API。
自 Google 引入以下地图使用限制< /a> 我向图像网址添加了一个关键参数。 密钥在此处生成:https://code.google.com/apis/console
之后我添加了关键参数,地图图像请求失败,并显示 403 状态代码和以下消息:此网站需要不同的 Google 地图 API 密钥。可以在 http://code.google.com/apis/maps/.
如果我删除密钥,请求将返回 200-OK 状态代码。
到目前为止,Google API 控制台中的报告显示约有 10 万个请求,即使客户端看不到任何地图图像。
我缺少什么?
I am using the Google Static Maps API.
Since Google introduced the following restriction for maps usage I added an key parameter to my image urls.
The key was generated here: https://code.google.com/apis/console
After I added the key parameter the map image requests fail with a 403 status code and the following message: This web site needs a different Google Maps API key. A new key can be generated at http://code.google.com/apis/maps/.
If I remove the key the requests return a 200-OK status code.
The reports in the Google APIs Console are showing ~100K requests so far, even though the clients don't see any Maps images.
What am I missing?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我遇到了同样的问题,并意识到我已经打开了 Maps v3 服务(假设覆盖了静态地图),但没有打开按字母顺序列表下方显示的静态地图服务。
希望有帮助。
I ran into the same problem and realized that I had turned on the Maps v3 service (assuming that covered static maps) but NOT the static maps service which appears further down the alphabetized list.
Hope that helps.
静态地图不再需要密钥,它们在控制台内也不可用。所以我猜你为maps-javascript-API 创建了一个密钥并将该密钥用于静态地图,这会导致错误。
静态地图中不再需要密钥,因为现在的限制与用户有关,而不是与提供者有关。
Static Maps don't require a key anymore, they are also not available inside the console. So I guess you created a key for a maps-javascript-API and use this key for a static map, what will result in the error.
There is no need for a key anymore in static maps, because the limits now are bound to the user and not to the provider.