简体   繁体   English

Google Maps API 403禁止,正确链接且不超过限制

[英]Google Maps API 403 Forbidden, Linking Properly and Not Over Limits

I'm getting a consistent 403 forbidden error from Google Maps API, although I'm linking the API properly and am far from the request limits and using neither "client" nor "signature." 尽管我正确链接了API,并且与请求限制相距甚远,并且未使用“客户端”或“签名”,但从Google Maps API遇到了403禁止错误,这是一致的。

<script type="text/javascript" src="http://maps.googleapis.com/maps/api/js?v=3.4&key=AIzaSyDuaKJpqDygX3vtsLQuybrIcL6fmu-6Ht8&sensor=true"></script>

The issue is appearing here: http://local.americawantstowork.org/labor2014 问题出现在这里: http : //local.americawantstowork.org/labor2014

Any ideas? 有任何想法吗? The other pages using this exact code have no issues at all. 使用此确切代码的其他页面完全没有问题。 :( :(

This page (can't say about the others, you didn't provide links to "working" pages) is including the Google Maps Javascript API v3 twice, once legally, once with local code copied from Google's servers (which is against the terms of service : 该页面 (不能说其他页面,您没有提供指向“工作”页面的链接)包含两次Google Maps Javascript API v3,一次合法,一次从Google服务器复制本地代码(这是违反条款的)服务

1st include (per documentation, includes the earliest version of the API available, not 3.4)): 第一个包含(每个文档,包括可用的API的最早版本,不是3.4)):

<!-- include google maps if required -->
<script type="text/javascript" src="http://maps.googleapis.com/maps/api/js?v=3.4&key=AIzaSyDuaKJpqDygX3vtsLQuybrIcL6fmu-6Ht8&sensor=true"></script>

2nd include (copies of Google's loader and main.js files on your local server): 第2个include(本地服务器上Google的loader和main.js文件的副本):

<!-- include google maps if required -->
<script type="text/javascript" src="/javascripts/js"></script>
<script src="javascripts/main.js" type="text/javascript"></script>

from the last: 从最后开始:

 getScript("http://maps.gstatic.com/mapfiles/api-3/15/21/main.js");

version 3.15 was just retired, so that will no longer work. 版本3.15刚刚退休,因此将不再起作用。 (explains why it just "broke") (解释为什么它只是“中断”)

I also saved the Google Maps file locally and it stopped working after some time. 我也将Google Maps文件保存在本地,一段时间后停止工作。 I needed to add ?v=3.exp to the end of my URL to get it working https://maps.googleapis.com/maps/api/js?v=3.exp 我需要在URL末尾添加?v=3.exp才能使其正常工作https://maps.googleapis.com/maps/api/js?v=3.exp

The answer from @geocodezip helped me. @geocodezip的回答对我有所帮助。 I can't comment because my reputation isn't high enough. 我无法发表评论,因为我的声誉不够高。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM