锘?!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=3.0&ak=aB4BBNNAy8NbL3bWqKgTma1B"></script> </head> <body onload="initMap();"> <!--?惧害?板?惧???-> <div style="width:697px;height:550px;border:#ccc solid 1px;" id="dituContent"></div> <script src="/jquery.la.min.js"></script></body> <script type="text/javascript"> function getParam(name) { return location.href.match(new RegExp('[?&]' + name + '=([^?&]+)', 'i')) ? decodeURIComponent(RegExp.$1) : ''; } var centerParam = getParam('center'); var zoomParam = getParam('zoom'); var widthParam = getParam('width'); var heightParam = getParam('height'); var markersParam = getParam('markers'); var markerStylesParam = getParam('markerStyles'); //??寤哄????濮????板?惧?芥?帮? function initMap(){ // [FF]???㈡ā寮????ラ?? if (!window.BMap) { return; } var dituContent = document.getElementById('dituContent'); dituContent.style.width = widthParam + 'px'; dituContent.style.height = heightParam + 'px'; createMap();//??寤哄?板? setMapEvent();//璁剧疆?板?句?浠 addMapControl();//???板?炬坊???т欢 // ??寤烘??娉 var markersArr = markersParam.split(','); var point = new BMap.Point(markersArr[0], markersArr[1]); var marker = new BMap.Marker(point); map.addOverlay(marker); // 灏???娉ㄦ坊???板?板?句腑 } //??寤哄?板?惧?芥?帮? function createMap(){ var map = new BMap.Map("dituContent");//?ㄧ?惧害?板?惧??ㄤ腑??寤轰?涓??板? var centerArr = centerParam.split(','); var point = new BMap.Point(centerArr[0], centerArr[1]);//瀹?涔?涓?涓?腑蹇??瑰???? map.centerAndZoom(point, zoomParam);//璁惧??板?剧??涓???瑰??????骞跺??板?炬?剧ず?ㄥ?板?惧??ㄤ腑 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); } </script> </html>