admin管理员组

文章数量:1327078

I have generated a Google Maps Javascript API v3 key for my website treblecode, and have added www.treblecode to the list of referrers on my developer account. I've also tried .treblecode/ to no avail.

However, in attempting to create a test HTML page according to the Hello World guidelines at developers.google/maps/documentation/javascript/tutorial#api_key, I receive the following error:

"Google has disabled use of the Maps API for this application. The provided key is not a valid Google API Key, or it is not authorized for the Google Maps Javascript API v3 on this site. If you are the owner of this application, you can learn about obtaining a valid key here: "

Below is the code I currently have on my test page at .html:

  <!DOCTYPE html>
    <html>
      <head>
        <style type="text/css">
          html, body, #map-canvas { height: 100%; margin: 0; padding: 0;}
        </style>
        <script type="text/javascript" src="">
        </script>
        <script type="text/javascript">
          function initialize() {
            var mapOptions = {
              center: { lat: -34.397, lng: 150.644},
              zoom: 8
            };
            var map = new google.maps.Map(document.getElementById('map-canvas'), mapOptions);
          }
          google.maps.event.addDomListener(window, 'load', initialize);
        </script>
      </head>
      <body>
    <div id="map-canvas"></div>
      </body>
    </html>

If it helps, my hosting provider is GoDaddy.

Any help would be appreciated here, as I'm not sure what else I need to do to properly work with that API.

I have generated a Google Maps Javascript API v3 key for my website treblecode., and have added www.treblecode. to the list of referrers on my developer account. I've also tried .treblecode./ to no avail.

However, in attempting to create a test HTML page according to the Hello World guidelines at developers.google./maps/documentation/javascript/tutorial#api_key, I receive the following error:

"Google has disabled use of the Maps API for this application. The provided key is not a valid Google API Key, or it is not authorized for the Google Maps Javascript API v3 on this site. If you are the owner of this application, you can learn about obtaining a valid key here: https://developers.google./maps/documentation/javascript/tutorial#api_key"

Below is the code I currently have on my test page at http://www.treblecode./apis/quickmap.html:

  <!DOCTYPE html>
    <html>
      <head>
        <style type="text/css">
          html, body, #map-canvas { height: 100%; margin: 0; padding: 0;}
        </style>
        <script type="text/javascript" src="https://maps.googleapis./maps/api/js?key=REDACTED">
        </script>
        <script type="text/javascript">
          function initialize() {
            var mapOptions = {
              center: { lat: -34.397, lng: 150.644},
              zoom: 8
            };
            var map = new google.maps.Map(document.getElementById('map-canvas'), mapOptions);
          }
          google.maps.event.addDomListener(window, 'load', initialize);
        </script>
      </head>
      <body>
    <div id="map-canvas"></div>
      </body>
    </html>

If it helps, my hosting provider is GoDaddy.

Any help would be appreciated here, as I'm not sure what else I need to do to properly work with that API.

Share Improve this question asked Nov 7, 2014 at 15:08 trebleCodetrebleCode 2,3282 gold badges24 silver badges35 bronze badges 1
  • Any updates you have to fix it? – Ananth Ramasamy Meenachi Commented Nov 10, 2014 at 4:44
Add a ment  | 

3 Answers 3

Reset to default 4

EDIT 27 july 2016

So, I said this at a time, not long ago, when this was true. It is not true anymore. Websites that were working perfectly in may 2016, stopped working suddenly.

So please disregard the text you see below.


You don't need the key. Just load "https://maps.googleapis./maps/api/js"

The Emmanuel's answer is outdated.

From June 22nd, 2016. Google requires an api key for Google Maps

  1. You have to go to Google Console and create a new project.
  2. Credentials > Create credentials > API Key

I'm not sure, how it resolved but I did the below steps, it worked.

  1. Go to https://console.developers.google./project/
  2. Created a new project and named it
  3. Go to "APIs & Auth" --> Push menu and add your domain name

本文标签: Google Maps Javascript API v3 Error Message quotKey is DisabledquotStack Overflow