锘?!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> ?惧害?板??PI???涔??板??/title> <!--寮??ㄧ?惧害?板??PI--> <style type="text/css"> html,body{margin:0;padding:0;} .iw_poi_title {color:#CC5522;font-size:14px;font-weight:bold;overflow:hidden;padding-right:13px;white-space:nowrap} .iw_poi_content {font:12px arial,sans-serif;overflow:visible;padding-top:4px;white-space:-moz-pre-wrap;word-wrap:break-word} </style> <script type="text/javascript" src="http://api.map.baidu.com/api?key=&v=1.1&services=true"></script> </head> <body> <script> (function(){ var bp = document.createElement('script'); var curProtocol = window.location.protocol.split(':')[0]; if (curProtocol === 'https') { bp.src = 'https://zz.bdstatic.com/linksubmit/push.js'; } else { bp.src = 'http://push.zhanzhang.baidu.com/push.js'; } var s = document.getElementsByTagName("script")[0]; s.parentNode.insertBefore(bp, s); })(); </script> <h1><a href="http://www.brainscapism.com" target="_blank">新澳门葡萄京下载|首页</a></h1> <!--?惧害?板?惧???-> <div style="width:697px;height:550px;border:#ccc solid 1px;" id="dituContent"></div> </body> <script type="text/javascript"> //??寤哄????濮????板?惧?芥?帮? function initMap(){ createMap();//??寤哄?板? setMapEvent();//璁剧疆?板?句?浠 addMapControl();//???板?炬坊???т欢 addMarker();//???板?句腑娣诲??marker } //??寤哄?板?惧?芥?帮? function createMap(){ var map = new BMap.Map("dituContent");//?ㄧ?惧害?板?惧??ㄤ腑??寤轰?涓??板? var point = new BMap.Point(108.280205,22.85664);//瀹?涔?涓?涓?腑蹇??瑰???? map.centerAndZoom(point,17);//璁惧??板?剧??涓???瑰??????骞跺??板?炬?剧ず?ㄥ?板?惧??ㄤ腑 window.map = map;//灏?map????瀛??ㄥ?ㄥ?ㄥ? } //?板?句?浠惰?缃??芥?帮? function setMapEvent(){ map.enableDragging();//???ㄥ?板?炬???戒?浠讹?榛?璁ゅ?????????) map.enableScrollWheelZoom();//???ㄥ?板?炬?杞??惧ぇ缂╁? map.enableDoubleClickZoom();//???ㄩ??????绘?惧ぇ锛?榛?璁ゅ?????????) map.enableKeyboard();//???ㄩ????涓?涓?宸﹀?抽??Щ?ㄥ?板? } //?板?炬?т欢娣诲???芥?帮? function addMapControl(){ //???板?句腑娣诲??缂╂?炬?т欢 var ctrl_nav = new BMap.NavigationControl({anchor:BMAP_ANCHOR_TOP_LEFT,type:BMAP_NAVIGATION_CONTROL_LARGE}); map.addControl(ctrl_nav); //???板?句腑娣诲??缂╃?ュ?炬?т欢 var ctrl_ove = new BMap.OverviewMapControl({anchor:BMAP_ANCHOR_BOTTOM_RIGHT,isOpen:1}); map.addControl(ctrl_ove); //???板?句腑娣诲??姣?渚?灏烘?т欢 var ctrl_sca = new BMap.ScaleControl({anchor:BMAP_ANCHOR_BOTTOM_LEFT}); map.addControl(ctrl_sca); } //??娉ㄧ?规?扮? var markerArr = [{title:"骞胯タ??澶у?颁?????????,content:"???′?绾匡?0771-8098903<br/>缁?????嚎锛?13657715890<br/> 涓???Q:20445917 2639938569/1946908030",point:"108.280591|22.855891",isOpen:1,icon:{w:21,h:21,l:0,t:0,x:6,lb:5}} ]; //??寤?arker function addMarker(){ for(var i=0;i<markerArr.length;i++){ var json = markerArr[i]; var p0 = json.point.split("|")[0]; var p1 = json.point.split("|")[1]; var point = new BMap.Point(p0,p1); var iconImg = createIcon(json.icon); var marker = new BMap.Marker(point,{icon:iconImg}); var iw = createInfoWindow(i); var label = new BMap.Label(json.title,{"offset":new BMap.Size(json.icon.lb-json.icon.x+10,-20)}); marker.setLabel(label); map.addOverlay(marker); label.setStyle({ borderColor:"#808080", color:"#333", cursor:"pointer" }); (function(){ var index = i; var _iw = createInfoWindow(i); var _marker = marker; _marker.addEventListener("click",function(){ this.openInfoWindow(_iw); }); _iw.addEventListener("open",function(){ _marker.getLabel().hide(); }) _iw.addEventListener("close",function(){ _marker.getLabel().show(); }) label.addEventListener("click",function(){ _marker.openInfoWindow(_iw); }) if(!!json.isOpen){ label.hide(); _marker.openInfoWindow(_iw); } })() } } //??寤?nfoWindow function createInfoWindow(i){ var json = markerArr[i]; var iw = new BMap.InfoWindow("<b class='iw_poi_title' title='" + json.title + "'>" + json.title + "</b><div class='iw_poi_content'>"+json.content+"</div>"); return iw; } //??寤轰?涓?con function createIcon(json){ var icon = new BMap.Icon("http://app.baidu.com/map/images/us_mk_icon.png", new BMap.Size(json.w,json.h),{imageOffset: new BMap.Size(-json.l,-json.t),infoWindowOffset:new BMap.Size(json.lb+5,1),offset:new BMap.Size(json.x,json.h)}) return icon; } initMap();//??寤哄????濮????板? </script> </html>