<script type="text/javascript"> //<![CDATA[ function onLoad() { // Center the map on Beijing var map = new GMap(document.getElementById("map")); map.addControl(new GSmallMapControl()); map.addControl(new GMapTypeControl()); map.centerAndZoom(new GPoint(116.416, 39.916), 13);
var BeijingStation = new GMarker (new GPoint (116.416,39.916)); GEvent.addListener (BeijingStation, "click", function() { BeijingStation.openInfoWindowHtml ("北京-中国的首都"); }); map.addOverlay (BeijingStation);
// Center the map on Smilingfish var SmilingfishStation = new GMarker (new GPoint (117.35,24.516)); GEvent.addListener (SmilingfishStation, "click", function() { SmilingfishStation.openInfoWindowHtml ("[福建]福建地区 googlemap<br>广告出租"); }); map.addOverlay (SmilingfishStation);
// Center the map on Liuyue var LiuyueStation = new GMarker (new GPoint (104.066,30.66)); GEvent.addListener (LiuyueStation, "click", function() { LiuyueStation.openInfoWindowHtml ("[四川重庆]鱼是不是在这个地方?"); }); map.addOverlay (LiuyueStation); // Center the map on Huoxian var HuoxianStation = new GMarker (new GPoint (113,28.2166)); GEvent.addListener (HuoxianStation, "click", function() { HuoxianStation.openInfoWindowHtml ("[湖南长沙]<br />超级女生~"); }); map.addOverlay (HuoxianStation);
// Center the map on Wuyi var WuyiStation = new GMarker (new GPoint (116.4,39.9)); GEvent.addListener (WuyiStation, "click", function() { WuyiStation.openInfoWindowHtml ("[北京海淀]<br /> 刘亦菲 你在吗?"); }); map.addOverlay (WuyiStation);
// Center the map on Wuyi2 var Wuyi2Station = new GMarker (new GPoint (108.3,22.8)); GEvent.addListener (Wuyi2Station, "click", function() { Wuyi2Station.openInfoWindowHtml ("[广西南宁]<br />美女很多~~~"); }); map.addOverlay (Wuyi2Station);
//绘制线条 var points = [new GPoint (116.416,39.916), new GPoint (112.533,37.866), new GPoint (117.35,24.516), new GPoint (113,28.2166),new GPoint (104.066,30.66),new GPoint (108.3,22.8)]; var line = new GPolyline(points, "#ff0000"); map.addOverlay(line);