谷歌地图api拒绝密钥

时间:2013-01-28 18:49:40

标签: google-maps api-key

我正在尝试通过网站上的api设置谷歌地图。 我在下一页生成了api密钥: https://developers.google.com/maps/documentation/javascript/tutorial#api_key

每次尝试加载地图时,Google都会拒绝我生成的api密钥。 以下是从Google网站上获取的代码示例:

<!DOCTYPE html>
<html>
  <head>
    <meta name="viewport" content="initial-scale=1.0, user-scalable=no" />
    <style type="text/css">
      html { height: 100% }
      body { height: 100%; margin: 0; padding: 0 }
      #map_canvas { height: 100% }
    </style>
    <script type="text/javascript" src="https://maps.googleapis.com/maps/api/js?key=AIzaSyCz6QrORRq1YjH9YOHreY_FahL0gbvudQo&amp;sensor=false"></script>
    <script type="text/javascript">
      function initialize() {
        var mapOptions = {
          center: new google.maps.LatLng(-34.397, 150.644),
          zoom: 8,
          mapTypeId: google.maps.MapTypeId.ROADMAP
        };
        var map = new google.maps.Map(document.getElementById("map_canvas"),
            mapOptions);
      }
    </script>
  </head>
  <body onload="initialize()">
    <div id="map_canvas" style="width:100%; height:100%"></div>
  </body>
</html>

我尝试允许推荐人或将其全部公开但无济于事。

我想我错过了什么,不知道吗?

1 个答案:

答案 0 :(得分:0)

您的密钥works for me。如果我使用特定于geocodezip.com的密钥,它也可以。

也许您的浏览器缓存中没有密钥的版本。

相关问题