Google static Maps always returning 403 when a key is provided

匿名 (未验证) 提交于 2019-12-03 09:06:55

问题:

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.

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) 

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

回答1:

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

Switching them in the API console fixed the problem.



标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!