简体   繁体   中英

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."

<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

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 :

1st include (per documentation, includes the earliest version of the API available, not 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):

<!-- 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. (explains why it just "broke")

I also saved the Google Maps file locally and it stopped working after some time. 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

The answer from @geocodezip helped me. I can't comment because my reputation isn't high enough.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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