Google Maps V3拒绝我的请求

时间:2013-08-01 10:51:10

标签: javascript google-maps google-maps-api-3

AM尝试在浏览器中加载谷歌地图,它一直在说

Google Maps API服务器拒绝了您的请求。请求中指定的“sensor”参数必须设置为“true”或“false”。

我的代码可能出现什么问题?

 <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=AIzaSyDHlCzPPFeUds2erogWbvRZreRC3PX-BJE&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);
      }
      google.maps.event.addDomListener(window, 'load', initialize);
    </script>

</head>
<body>
<div id="map-canvas">

</div>

</body>
</html>

1 个答案:

答案 0 :(得分:1)

我正在这里,但你试过把它改成了 https://maps.googleapis.com/maps/api/js?key=AIzaSyDHlCzPPFeUds2erogWbvRZreRC3PX-BJE&sensor=false&lt; - 小案例