0
我正在關注Google的這個tutorial關於如何在html頁面中使用簡單的地圖。但是,當我運行代碼時,只顯示一個灰色方塊(我創建的div)。任何人都可以幫我嗎?Google Maps API - 地圖不顯示
這裏是我使用的代碼:
<!DOCTYPE html>
<html>
<head>
<style>
#map_canvas {
width: 500px;
height: 500px;
background-color: #CCC;
}
</style>
<script src="http://maps.googleapis.com/maps/api/js?sensor=false"></script>
<script>
function initialize() {
var ap_canvas = document.getComputedStyle('map_canvas');
var mapOptions = { new google.maps.Lating(44.5403, -78.5463),
zoom:8,
mapTypeld: google.maps.MapTypeId.ROADMAP }
var map = new google.maps.Map(map_canvas, mapOptions)
}
google.maps.event.addDomListener(window, 'load', initialize);
</script>
</head>
<body>
<div id="map_canvas">
</div>
</body>
</html>
謝謝!有效 – 2013-04-27 15:43:27