首页 文章

谷歌 Map api拒绝密钥

提问于
浏览
0

我'm trying to set up google map via the api on a website. I' ve在下一页生成了api密钥:https://developers.google.com/maps/documentation/javascript/tutorial#api_key

每次我尝试加载 Map 时,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

    你的钥匙works for me . 如果我使用特定于geocodezip.com的键,它也可以工作 .

    也许你的浏览器缓存中没有密钥的版本 .

相关问题