Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Google Maps API - disabled on domain

When page loads i get the message as javascript alert: Google has disabled use of the Maps API for this application. See the Terms of Service for more information: http://www.google.com/intl/en-US_US/help/terms_maps.html.

Everything working fine till today. Google webmasters tool didnt told me anything.

My question is wherer can i find more informations why exacly this page has been banned/blocked. (In terms there are lots of possible reasons)

What to do to unblock this? Who or where to send the request?

like image 326
Michael Avatar asked Aug 08 '12 11:08

Michael


2 Answers

My web application had this same error occur, and we fixed it by updating our link to the Google Maps API file.

Previously we were using a downloaded version of the Maps API file located at http://maps.googleapis.com/maps/api/js?key=YOUR_API_KEY&sensor=SET_TO_TRUE_OR_FALSE.

When we instead used the direct link, this particular error went away.

Edit: Even if you're directly linking to Google's js file, make sure your application isn't using an older locally cached version.

Not working version:

<script type="text/javascript" src="local_google_maps_api.js">

Working version:

<script type="text/javascript" src="http://maps.googleapis.com/maps/api/js?key=YOUR_API_KEY&sensor=SET_TO_TRUE_OR_FALSE">

Google likely started invalidating Google API v3 calls using older address versions. The Javascript code files mainly differ in the API IP address call

like image 165
Steve Feng Avatar answered Oct 21 '22 23:10

Steve Feng


For everyone getting this error / alert, you must:

1.) Ensure that you are linking to the online API, as noted by Steve Feng. Replace your code for accessing the Google API file with this:

<script type="text/javascript" src="http://maps.googleapis.com/maps/api/js?key=YOUR_API_KEY&sensor=SET_TO_TRUE_OR_FALSE">

2.) Make sure you clear your page's cache - even if you were already accessing the file with the code above(like I was). This may be done quickly if you're working on a Windows platform by pressing [ctrl] + [F5], or by pressing [cmd] + [R] on a Mac(or ['apple'] + [R]). On linux a simple [F5] should force refresh. If this button combination didn't work(or doesn't apply to you), look at this website for more information on clearing your cache.

After you've cleared your cache and made sure your code accesses the API file from the URL posted above, you should not get that message anymore(as far as I have experienced).

AFAIK, this message appears regardless of you actually breaking Google's Terms and Conditions or not. Furthermore, I have found this message may appear when using a Google API that isn't Google Maps. One example of a complaint here (at bottom).

I have no straight evidence to believe this, but I think this message became Google's default(-ish) error message when you did something to upset one of their APIs.

like image 21
cNovak Avatar answered Oct 21 '22 22:10

cNovak