0
我有一個自定義谷歌地圖。看起來很簡單。HTML和谷歌地圖打得不好
<!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>
<title></title>
<meta name="viewport" content="initial-scale=1.0, user-scalable=no" />
<!--google magic-->
<script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false"></script>
<!--custom map-->
<script type="text/javascript">
function initialize() {
var latlngcenter = new google.maps.LatLng(41.523387, -87.691545);
//move center west of marker to show I-57
var myOptions = { zoom: 11, center: latlngcenter, mapTypeId: google.maps.MapTypeId.ROADMAP };
var map = new google.maps.Map(document.getElementById("GardenWalk_Canvas"), myOptions);
var latlng;
var marker;
latlng = new google.maps.LatLng(41.503387, -87.636545);
marker = new google.maps.Marker({ position: latlng, map: map });
latlng = new google.maps.LatLng(41.520935, -87.582318);
marker = new google.maps.Marker({ position: latlng, map: map });
latlng = new google.maps.LatLng(41.520075, -87.634509);
marker = new google.maps.Marker({ position: latlng, map: map });
latlng = new google.maps.LatLng(41.538092, -87.677964);
marker = new google.maps.Marker({ position: latlng, map: map });
latlng = new google.maps.LatLng(41.536256, -87.678006);
marker = new google.maps.Marker({ position: latlng, map: map });
latlng = new google.maps.LatLng(41.533099, -87.682250);
marker = new google.maps.Marker({ position: latlng, map: map });
latlng = new google.maps.LatLng(41.550018, -87.691408);
marker = new google.maps.Marker({ position: latlng, map: map });
latlng = new google.maps.LatLng(41.550017, -87.691305);
marker = new google.maps.Marker({ position: latlng, map: map });
latlng = new google.maps.LatLng(41.508768, -87.693976);
marker = new google.maps.Marker({ position: latlng, map: map });
latlng = new google.maps.LatLng(41.509065, -87.694586);
marker = new google.maps.Marker({ position: latlng, map: map });
latlng = new google.maps.LatLng(41.498524, -87.810122);
marker = new google.maps.Marker({ position: latlng, map: map });
}
</script>
</head>
<body onload="initialize()">
<div id="GardenWalk_Canvas" style="width: 500; height: 350" />
text after
</body>
</html>
唯一的問題是,下面被刪除時,地圖僅顯示:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
任何想法或莫名其妙,爲什麼?
哦,我只是說,這裏的事實後,爲了分離,使一些地區更容易在這裏閱讀SO。他們沒有在我釋放。我爲此道歉。 – Jim 2010-06-25 13:45:05
好的,我想我找到了你的問題 - 缺少「px」。 風格= 「寬度:500;高度:350」 應該是 風格= 「寬度:500像素;高度:350像素」 – JiJ 2010-06-25 13:55:01
就是這樣。這通常是一些小事情,並與我一起在深夜工作。謝謝。 – Jim 2010-06-25 13:58:36