< html > < head > < xml:namespace ns ="urn:schemas-microsoft-com:vml" prefix ="v" /> < style > ... v:* {...}{ behavior: url(#default#VML);} </ style > < link type ="text/css" rel ="stylesheet" href ="MapTools.css" /> <!-- 配置文件 --> < script src ="MapConfig.js" ></ script > < script src ="UserConfig.js" ></ script > <!-- 应用程序 --> < script src ="Common.js" ></ script > < script src ="CMap.js" ></ script > < script src ="VMLDrawer.js" ></ script > < script src ="Trigger.js" ></ script > < script src ="MapTools.js" ></ script > </ head > < body > < div id ="mapContainer" ></ div > < script > ... var map = new CMap(); map.init(); map.addLine(...{ id:"line", points:"0,0 100,100 500,800", offset:"1,1 1,1 -3,4", split:...{ up:"1,0 3,2 5,1", down:"2,1 3,2 5,0" }, color:"blue", weight:3.5, alpha:60, events:...{ click:...{callback:line_clicked}, mouseon:...{color:"red", callback:line_mouseon}, mouseout:...{callback:line_mouseout} } }); map.drawVml(); function line_clicked(id)...{ alert(id+"被点击"); } function line_mouseon(id)...{ alert("鼠标在"+id+"上"); } function line_mouseout(id)...{ alert("鼠标离开"+id); } </ script > </ body > </ html >