0

页面上的这个 javascript 代码不会显示地图。有什么建议么?是 Caja 消毒剂阻止了执行吗?谢谢!心电图

    <!DOCTYPE html>
    \\To load the APIs. I have found this code on https://developers.google.com/loader/;
    <script type="text/javascript" src="https://www.google.com/jsapi"></script>
    <script type="text/javascript">
   \\next load then specific API module with parameters and Callback
    function loadMaps(){
        google.load("maps", "3",{"callback" : mapsLoaded()}, sensor=false, key="AIzaSyBfB1qRhJJiHGFUNtI87yfTrVLx-C8YYp4");
      }
    </script>
    <script type="text/javascript"> 
      var geocoder;
      var map;
      function mapsLoaded() {
    //this is how far the code is executed;
        alert("br");
        var latlng = new google.maps.LatLng(52.2989, 4.9219);
    //this alert does not show up;
        alert(latlng);
        var mapOptions = {
          zoom: 8,
          center: latlng,
          mapTypeId: google.maps.MapTypeId.ROADMAP
        }
            map = new google.maps.Map(document.getElementById("map_canvas"), mapOptions);
      }

    </script> 

    <body onload="loadMaps()">
      <div id="map_canvas" style="width: 100%; height: 200px;"></div>
    </body> 
    </html>
4

1 回答 1

0

HtmlService/Caja 尚不支持 Google API。我们正在努力对通行证进行消毒。

于 2012-08-29T13:36:33.743 回答