當我使用Google地圖API時,無法顯示我的地圖。我正在嘗試構建一個應用程序,並且它不會在那裏工作,但是在我製作的這個測試頁面中它也被破壞了。有誰知道我做錯了什麼?未顯示Google地圖API地圖
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
<script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false"></script>
<script type="text/javascript">
function initialize() {
console.log("Initializing...");
var latlng = new google.maps.LatLng(-34.397, 150.644);
var myOptions = {
zoom: 8,
center: latlng,
mapTypeId: google.maps.MapTypeId.ROADMAP
};
var map = new google.maps.Map(document.getElementById("map_canvas"),
myOptions);
}
</script>
</head>
<body onload="initialize()">
<div id="map_canvas" style="height: 100%; width: 100%;"></div>
</body>
</html>
感謝您的任何幫助。我很困惑!
這是相關的,也許回答這個問題 http://stackoverflow.com/a/10210153/1330710 – rolfk 2013-09-17 12:51:24