此頁面上的JavaScript代碼不會顯示地圖。有什麼建議麼?它是否阻止執行的Caja消毒劑? Thankx! Cor谷歌應用腳本html服務和加載谷歌地圖javascript api V3
<!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>
[使用完整的Google Maps V3 API及其在Google Apps腳本中的所有功能](http://stackoverflow.com/questions/11820188/use-the-full-google-maps-v3-api-和所有功能在谷歌應用程序腳本) –