<!DOCTYPE html "-//W3C//DTD XHTML 1.0 Strict//EN"
"">
<html xmlns="">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8"/>
<title>Google Maps JavaScript API Example</title>
<script src=""
type="text/javascript"></script>
<script type="text/javascript">
function initialize() {
//初始化
if (GBrowserIsCompatible()) {
//使用的DIV名称,设定初始大小
var map = new GMap2(document.getElementById("map_canvas"),
{ size: new GSize(500,300) });
//设置地图位置按钮
map.addControl(new GSmallMapControl());
map.addControl(new GMapTypeControl());
//初始化默认的中心的位置
var geoPoint0= new GLatLng(40.036837,116.322410);
//设置距离比率
map.setCenter(geoPoint0, 15);
//初始化按钮的位置
var marker0 = new GMarker(geoPoint0);
map.addOverlay(marker0);
//初始化按钮上的文字内容
marker0.openInfoWindowHtml("have a TEST ");
}
}
</script>
</head>
<body onload="initialize()" onunload="GUnload()">
<div id="map_canvas" style="width: 500px; height: 300px"></div>
</body>
</html>
|