提供密钥时,Google静态地图始终返回403 [英] Google static Maps always returning 403 when a key is provided

查看:99
本文介绍了提供密钥时,Google静态地图始终返回403的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果我在地图请求中提供了一个API密钥,我总是会得到一个403 Forbidden响应;没有指定它一切顺利,我可以到达地图。问题是,我必须使用API​​密钥才能监控使用情况和每用户配额。

I always get a 403 Forbidden response if I provide an API key within the map request; without specifying it everything goes well and I can get to the map. The problem is that I have to work with an API key in order to monitor usage and per-user quota.

以下是一个示例:
http://jsfiddle.net/demerzel3/ZUC6m/

Here's an example: http://jsfiddle.net/demerzel3/ZUC6m/

http://maps.googleapis.com/maps/api/staticmap?key=AIzaSyDqq140S23Q_H_dmyUIFz-YwsbH_rCSFSs&size=320x140&scale=2&zoom=15&sensor=false&markers=color:0xEE6B1C|label:A|V.%20FALCONE%207%20CASALETTO%20LODIGIANO%20(LO)



<在上面的示例中,我使用已配置的已注册API密钥来允许jsfiddle作为引用者(如有必要,我可以附上API控制台的屏幕截图)。
我在做什么错误?

In the example above I'm using a registered API Key configured in order to allow jsfiddle as a referer (I can attach a screenshot of the API Console if necessary). What am I doing wrong?

谢谢

Thanks

推荐答案

我最终排除了问题,问题是我订阅了Google Maps API v2服务而不是Static Maps API。

I finally sorted things out, the problem was that I was subscribing to the "Google Maps API v2" service instead of "Static Maps API".

在API控制台中切换它们可以解决问题。

Switching them in the API console fixed the problem.

这篇关于提供密钥时,Google静态地图始终返回403的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆