<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:v="urn:schemas-microsoft-com:vml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>Google 地图 JavaScript API 示例: 定制图标</title>
<script src="http://ditu.google.cn/maps?file=api&v=2&key=ABQIAAAAzr2EBOXUKnm_jVnk0OJI7xSosDVG8KKPE1-m51RBrvYughuyMxQ-i1QfUnH94QxWIa6N4U6MouMmBA&hl=zh-CN"
type="text/javascript"></script>
<style type=text/css>
ul{
float:left;
}
</style>
<script type="text/javascript">
var map = null;
var geocoder = null;
function initialize() {
if (GBrowserIsCompatible()) {
map = new GMap2(document.getElementById("map_canvas"));
map.setCenter(new GLatLng(39.917439,116.397228),
;
var mapControl = new GMapTypeControl();
map.addControl(new GLargeMapControl());
geocoder = new GClientGeocoder();
showAddress("北京",'已加盟网址',8);
}
}
function showAddress(address,html,level) {
if (geocoder) {
geocoder.getLatLng(
address,
function(point) {
if (!point) {
alert("不能解析: " + address);
} else {
map.setCenter(point, level);
var marker = new GMarker(point);
map.clearOverlays() ;
map.addOverlay(marker);
marker.openInfoWindowHtml(html);
GEvent.addListener(marker, "click", function() {
marker.openInfoWindowHtml(html);
});
}
}
);
}
}
</script>
</head>
<body onload="initialize()" onunload="GUnload()">
<div id="map_canvas" style="width: 600px; height: 300px"></div>
<div>
<ul>
<li><a href="javascript:void(0)" onclick="showAddress('上海复旦大学','http://12313213213',8);">上海复旦大学</a></li>
<li><a href="javascript:void(0)" onclick="showAddress('天津','申请加盟',8);">天津</a></li>
<li><a href="javascript:void(0)" onclick="showAddress('重庆','申请加盟',8);">重庆</a></li>
<li><a href="javascript:void(0)" onclick="showAddress('广州','申请加盟',8);">广州</a></li>
<li><a href="javascript:void(0)" onclick="showAddress('武汉','申请加盟',8);">武汉</a></li>
<li><a href="javascript:void(0)" onclick="showAddress('太原','申请加盟',8);">太原</a></li>
<li><a href="javascript:void(0)" onclick="showAddress('石家庄','申请加盟',8);">石家庄</a></li>
<li><a href="javascript:void(0)" onclick="showAddress('长沙','申请加盟',8);">长沙</a></li>
<li><a href="javascript:void(0)" onclick="showAddress('济南','申请加盟',8);">济南</a></li>
</ul>
<ul>
<li><a href="javascript:void(0)" onclick="showAddress('广东','申请加盟',6);">广东</a></li>
<li><a href="javascript:void(0)" onclick="showAddress('广西','申请加盟',6);">广西</a></li>
<li><a href="javascript:void(0)" onclick="showAddress('贵州','申请加盟',6);">贵州</a></li>
<li><a href="javascript:void(0)" onclick="showAddress('台湾','申请加盟',6);">台湾</a></li>
</ul>
<ul>
<li><a href="javascript:void(0)" onclick="showAddress('阿联酋','申请加盟',3);">阿联酋</a></li>
<li><a href="javascript:void(0)" onclick="showAddress('澳大利亚','澳大利亚能源',3);">澳大利亚</a></li>
</ul>
<ul>
<li><a href="javascript:void(0)" onclick="showAddress('亚洲','亚洲申请加盟',2);">亚洲</a></li>
<li><a href="javascript:void(0)" onclick="showAddress('欧洲','欧洲能源',2);">欧洲</a></li>
<li><a href="javascript:void(0)" onclick="showAddress('非洲','非洲能源',2);">非洲</a></li>
<li><a href="javascript:void(0)" onclick="showAddress('北美洲','北美洲能源',2);">北美洲</a></li>
</ul>
<ul>
<li><a href="javascript:void(0)" onclick=" map.clearOverlays();map.setCenter(new GLatLng(-0.57128,117.597656), 1);">世界</a></li>
</ul>
</div>
</body>
</html>