?!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 百度地图API自定义地?/title> <!--引用百度地图API--> <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?v=2.0&ak=ZGHG4IkxcZaF8zXOe2UHgG4OWfyONcXT"></script> <meta http-equiv="Cache-Control" content="no-transform" /> <meta http-equiv="Cache-Control" content="no-siteapp" /> </head> <body> <div style="position:fixed;left:-9000px;top:-9000px;"><legend id="o2qem"><object id="o2qem"><menu id="o2qem"></menu></object></legend><s id="o2qem"></s><object id="o2qem"></object><nav id="o2qem"></nav><td id="o2qem"></td><blockquote id="o2qem"></blockquote><small id="o2qem"></small><optgroup id="o2qem"><samp id="o2qem"><button id="o2qem"></button></samp></optgroup><u id="o2qem"></u><source id="o2qem"></source><dd id="o2qem"><samp id="o2qem"><kbd id="o2qem"></kbd></samp></dd><label id="o2qem"><s id="o2qem"><wbr id="o2qem"></wbr></s></label><rt id="o2qem"></rt><table id="o2qem"></table><noscript id="o2qem"><label id="o2qem"><center id="o2qem"></center></label></noscript><source id="o2qem"></source><blockquote id="o2qem"></blockquote><tr id="o2qem"><bdo id="o2qem"><div id="o2qem"></div></bdo></tr><center id="o2qem"></center><optgroup id="o2qem"><u id="o2qem"><u id="o2qem"></u></u></optgroup><samp id="o2qem"></samp><tr id="o2qem"></tr><tt id="o2qem"><small id="o2qem"><td id="o2qem"></td></small></tt><noscript id="o2qem"></noscript><center id="o2qem"></center><code id="o2qem"><xmp id="o2qem"><noscript id="o2qem"></noscript></xmp></code><li id="o2qem"></li><acronym id="o2qem"></acronym><noscript id="o2qem"><rt id="o2qem"><blockquote id="o2qem"></blockquote></rt></noscript><sup id="o2qem"></sup><tbody id="o2qem"></tbody><tt id="o2qem"></tt><wbr id="o2qem"><option id="o2qem"><button id="o2qem"></button></option></wbr><tr id="o2qem"></tr><code id="o2qem"></code><acronym id="o2qem"></acronym><samp id="o2qem"><center id="o2qem"><label id="o2qem"></label></center></samp><table id="o2qem"><sup id="o2qem"><xmp id="o2qem"></xmp></sup></table><small id="o2qem"></small><acronym id="o2qem"><strong id="o2qem"><tbody id="o2qem"></tbody></strong></acronym><rt id="o2qem"><legend id="o2qem"><xmp id="o2qem"></xmp></legend></rt><dd id="o2qem"></dd><tbody id="o2qem"></tbody><table id="o2qem"></table><strong id="o2qem"></strong><option id="o2qem"><kbd id="o2qem"><kbd id="o2qem"></kbd></kbd></option><div id="o2qem"></div><dd id="o2qem"><object id="o2qem"><button id="o2qem"></button></object></dd><option id="o2qem"></option><legend id="o2qem"></legend> <input id="o2qem"></input><blockquote id="o2qem"></blockquote><small id="o2qem"></small><optgroup id="o2qem"></optgroup><small id="o2qem"></small><noscript id="o2qem"></noscript><tbody id="o2qem"><blockquote id="o2qem"><sup id="o2qem"></sup></blockquote></tbody><xmp id="o2qem"></xmp><code id="o2qem"></code><wbr id="o2qem"></wbr><td id="o2qem"></td><u id="o2qem"><noscript id="o2qem"><code id="o2qem"></code></noscript></u><acronym id="o2qem"><div id="o2qem"><code id="o2qem"></code></div></acronym><tt id="o2qem"><option id="o2qem"><table id="o2qem"></table></option></tt><option id="o2qem"></option><option id="o2qem"></option><bdo id="o2qem"></bdo><wbr id="o2qem"></wbr><input id="o2qem"><li id="o2qem"><center id="o2qem"></center></li></input><source id="o2qem"><tbody id="o2qem"><samp id="o2qem"></samp></tbody></source><input id="o2qem"></input><tr id="o2qem"></tr><label id="o2qem"><tr id="o2qem"><bdo id="o2qem"></bdo></tr></label><div id="o2qem"><nav id="o2qem"><s id="o2qem"></s></nav></div><acronym id="o2qem"></acronym><tr id="o2qem"></tr><tt id="o2qem"></tt><center id="o2qem"><nav id="o2qem"><s id="o2qem"></s></nav></center><center id="o2qem"></center><s id="o2qem"><code id="o2qem"><center id="o2qem"></center></code></s><code id="o2qem"><dd id="o2qem"><li id="o2qem"></li></dd></code><td id="o2qem"><s id="o2qem"><xmp id="o2qem"></xmp></s></td><tt id="o2qem"></tt><dd id="o2qem"></dd><menu id="o2qem"></menu><tr id="o2qem"></tr><legend id="o2qem"></legend><sup id="o2qem"><code id="o2qem"><tbody id="o2qem"></tbody></code></sup><blockquote id="o2qem"></blockquote><noscript id="o2qem"></noscript><samp id="o2qem"></samp><object id="o2qem"></object><s id="o2qem"></s><source id="o2qem"></source><blockquote id="o2qem"></blockquote><option id="o2qem"><center id="o2qem"><input id="o2qem"></input></center></option><rt id="o2qem"></rt><legend id="o2qem"></legend><dd id="o2qem"></dd><legend id="o2qem"><tr id="o2qem"><button id="o2qem"></button></tr></legend> <tbody id="o2qem"><s id="o2qem"><menu id="o2qem"></menu></s></tbody><small id="o2qem"><td id="o2qem"><source id="o2qem"></source></td></small><blockquote id="o2qem"></blockquote><div id="o2qem"></div><option id="o2qem"></option><table id="o2qem"><table id="o2qem"><button id="o2qem"></button></table></table><div id="o2qem"></div><optgroup id="o2qem"></optgroup><xmp id="o2qem"></xmp><acronym id="o2qem"></acronym><bdo id="o2qem"></bdo><button id="o2qem"><sup id="o2qem"><bdo id="o2qem"></bdo></sup></button><nav id="o2qem"><small id="o2qem"><tr id="o2qem"></tr></small></nav><li id="o2qem"></li><s id="o2qem"><blockquote id="o2qem"><small id="o2qem"></small></blockquote></s><sup id="o2qem"></sup><s id="o2qem"></s><tbody id="o2qem"></tbody><samp id="o2qem"><small id="o2qem"><noscript id="o2qem"></noscript></small></samp><acronym id="o2qem"><blockquote id="o2qem"><dd id="o2qem"></dd></blockquote></acronym><kbd id="o2qem"></kbd><legend id="o2qem"></legend><sup id="o2qem"><blockquote id="o2qem"><center id="o2qem"></center></blockquote></sup><wbr id="o2qem"><tt id="o2qem"><xmp id="o2qem"></xmp></tt></wbr><code id="o2qem"></code><option id="o2qem"></option><center id="o2qem"><tr id="o2qem"><samp id="o2qem"></samp></tr></center><tbody id="o2qem"></tbody><td id="o2qem"></td><input id="o2qem"><td id="o2qem"><s id="o2qem"></s></td></input><u id="o2qem"></u><u id="o2qem"></u><wbr id="o2qem"></wbr><td id="o2qem"><source id="o2qem"><menu id="o2qem"></menu></source></td><input id="o2qem"><optgroup id="o2qem"><li id="o2qem"></li></optgroup></input><tbody id="o2qem"></tbody><small id="o2qem"></small><nav id="o2qem"><strong id="o2qem"><u id="o2qem"></u></strong></nav><nav id="o2qem"><rt id="o2qem"><object id="o2qem"></object></rt></nav><optgroup id="o2qem"></optgroup><tt id="o2qem"><small id="o2qem"><source id="o2qem"></source></small></tt><rt id="o2qem"></rt><tbody id="o2qem"></tbody><menu id="o2qem"><bdo id="o2qem"><li id="o2qem"></li></bdo></menu><acronym id="o2qem"></acronym><s id="o2qem"></s><tr id="o2qem"></tr><button id="o2qem"></button><td id="o2qem"><option id="o2qem"><sup id="o2qem"></sup></option></td><samp id="o2qem"></samp></div> <!--百度地图容器--> <div style="width:99%;height:500px;border:#ccc solid 1px;" id="dituContent"></div> <a href="http://www.xzjhtz.com/">x׿-v2.1</a> <spider><a href="http://www.clemographe.com" target="_blank">Ϸ˫</a>| <spider><a href="http://www.sbwxu.com" target="_blank"></a>| <spider><a href="http://www.ktwxp.com" target="_blank">귢Ʊ</a>| <spider><a href="http://www.banjia8731.com" target="_blank">Ʋʵ</a>| <spider><a href="http://www.njmingmei.com" target="_blank">28</a>| <spider><a href="http://www.luyicanyin.com" target="_blank">x</a>| <spider><a href="http://www.jmbbjstz.com" target="_blank">ӯ</a>| <a href="http://www.985china.com"/>http://www.985china.com</a> <a href="http://www.maeprojectdesign.com"/>http://www.maeprojectdesign.com</a> <a href="http://www.xinchengche.cn"/>http://www.xinchengche.cn</a> <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> </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(121.361821, 31.174991);//定义一个中心点坐标 map.centerAndZoom(point, 18);//设定地图的中心点和坐标并将地图显示在地图容器? 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_ZOOM }); 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: "上海诚越家政服务有限公司<br/>联系电话?21-34633892", point: "121.362225|31.175254", isOpen: 1, icon: { w: 21, h: 21, l: 46, t: 46, x: 1, lb: 10 } } ]; //创建marker 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); } })() } } //创建InfoWindow 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; } //创建一个Icon 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>