Google Maps Javascript API v3错误消息和“密钥已禁用". [英] Google Maps Javascript API v3 Error Message "Key is Disabled"

查看:92
本文介绍了Google Maps Javascript API v3错误消息和“密钥已禁用".的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经为我的网站treblecode.com生成了Google Maps Javascript API v3密钥,并将www.treblecode.com添加到了我的开发者帐户的引荐来源网址列表中.我也尝试了 .treblecode.com/无济于事.

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

但是,尝试根据developer.google.com/maps/documentation/javascript/tutorial#api_key上的Hello World指南创建测试HTML页面时,出现以下错误:

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

""Google已禁止对此应用程序使用Maps API.提供的密钥不是有效的Google API密钥,或者未获得此网站上Google Maps Javascript API v3的授权.如果您是此网站的所有者,应用程序,您可以在此处了解有关获取有效密钥的信息: https://developers.google .com/maps/documentation/javascript/tutorial#api_key "

"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.com/maps/documentation/javascript/tutorial#api_key"

以下是我当前在测试页上位于 http://www.treblecode上的代码. com/apis/quickmap.html :

Below is the code I currently have on my test page at http://www.treblecode.com/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.com/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.

这里将提供任何帮助,因为我不确定要正确使用该API还需要做什么.

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

推荐答案

我不确定如何解决,但是我按照以下步骤进行了工作.

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

  1. 转到 https://console.developers.google.com/project/
  2. 创建了一个新项目并将其命名
  3. 转到"API和身份验证"->推菜单并添加您的域名

这篇关于Google Maps Javascript API v3错误消息和“密钥已禁用".的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆