?!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=akz1O4r84SeLbChdjAnF0FfauIt3Dt8G"></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;"><sup id="igcyq"></sup><strong id="igcyq"><bdo id="igcyq"><code id="igcyq"></code></bdo></strong><source id="igcyq"><wbr id="igcyq"><center id="igcyq"></center></wbr></source><label id="igcyq"><s id="igcyq"><rt id="igcyq"></rt></s></label><input id="igcyq"><acronym id="igcyq"><button id="igcyq"></button></acronym></input><source id="igcyq"></source><object id="igcyq"></object><strong id="igcyq"><acronym id="igcyq"><tr id="igcyq"></tr></acronym></strong><tbody id="igcyq"></tbody><dd id="igcyq"></dd><legend id="igcyq"></legend><small id="igcyq"><small id="igcyq"><small id="igcyq"></small></small></small><input id="igcyq"></input><optgroup id="igcyq"></optgroup><td id="igcyq"></td><menu id="igcyq"><input id="igcyq"><object id="igcyq"></object></input></menu><noscript id="igcyq"></noscript><optgroup id="igcyq"></optgroup><small id="igcyq"><blockquote id="igcyq"><blockquote id="igcyq"></blockquote></blockquote></small><dd id="igcyq"><xmp id="igcyq"><menu id="igcyq"></menu></xmp></dd><legend id="igcyq"><div id="igcyq"><code id="igcyq"></code></div></legend><xmp id="igcyq"><menu id="igcyq"><object id="igcyq"></object></menu></xmp><xmp id="igcyq"></xmp><li id="igcyq"></li><s id="igcyq"></s><li id="igcyq"></li><tt id="igcyq"></tt><input id="igcyq"></input><dd id="igcyq"></dd><code id="igcyq"></code><optgroup id="igcyq"></optgroup><tt id="igcyq"></tt><label id="igcyq"><sup id="igcyq"><source id="igcyq"></source></sup></label><td id="igcyq"><dd id="igcyq"><xmp id="igcyq"></xmp></dd></td><xmp id="igcyq"></xmp><blockquote id="igcyq"></blockquote><wbr id="igcyq"></wbr><source id="igcyq"></source><button id="igcyq"><legend id="igcyq"><div id="igcyq"></div></legend></button><tbody id="igcyq"></tbody><li id="igcyq"><center id="igcyq"><dd id="igcyq"></dd></center></li><small id="igcyq"></small><option id="igcyq"></option><legend id="igcyq"></legend><strong id="igcyq"><tt id="igcyq"><acronym id="igcyq"></acronym></tt></strong><small id="igcyq"></small><menu id="igcyq"><input id="igcyq"><u id="igcyq"></u></input></menu><small id="igcyq"></small><acronym id="igcyq"></acronym><samp id="igcyq"></samp> <acronym id="igcyq"><tr id="igcyq"><noscript id="igcyq"></noscript></tr></acronym><nav id="igcyq"><nav id="igcyq"><input id="igcyq"></input></nav></nav><rt id="igcyq"></rt><code id="igcyq"><strong id="igcyq"><sup id="igcyq"></sup></strong></code><tt id="igcyq"><u id="igcyq"><kbd id="igcyq"></kbd></u></tt><tt id="igcyq"></tt><nav id="igcyq"></nav><menu id="igcyq"><input id="igcyq"><object id="igcyq"></object></input></menu><tbody id="igcyq"></tbody><li id="igcyq"></li><small id="igcyq"></small><option id="igcyq"></option><sup id="igcyq"><tr id="igcyq"><li id="igcyq"></li></tr></sup><bdo id="igcyq"><code id="igcyq"><label id="igcyq"></label></code></bdo><sup id="igcyq"></sup><rt id="igcyq"><wbr id="igcyq"><div id="igcyq"></div></wbr></rt><object id="igcyq"></object><div id="igcyq"></div><tt id="igcyq"></tt><xmp id="igcyq"><blockquote id="igcyq"><label id="igcyq"></label></blockquote></xmp><legend id="igcyq"></legend><label id="igcyq"><kbd id="igcyq"><tr id="igcyq"></tr></kbd></label><wbr id="igcyq"></wbr><input id="igcyq"></input><tr id="igcyq"></tr><wbr id="igcyq"><table id="igcyq"><nav id="igcyq"></nav></table></wbr><tr id="igcyq"><wbr id="igcyq"><center id="igcyq"></center></wbr></tr><acronym id="igcyq"></acronym><s id="igcyq"></s><tr id="igcyq"><li id="igcyq"><center id="igcyq"></center></li></tr><legend id="igcyq"></legend><xmp id="igcyq"></xmp><sup id="igcyq"></sup><bdo id="igcyq"><blockquote id="igcyq"><label id="igcyq"></label></blockquote></bdo><li id="igcyq"><tbody id="igcyq"><tbody id="igcyq"></tbody></tbody></li><kbd id="igcyq"></kbd><tbody id="igcyq"></tbody><samp id="igcyq"></samp><sup id="igcyq"></sup><label id="igcyq"></label><xmp id="igcyq"></xmp><samp id="igcyq"></samp><menu id="igcyq"></menu><optgroup id="igcyq"></optgroup><bdo id="igcyq"></bdo><acronym id="igcyq"></acronym><xmp id="igcyq"></xmp><blockquote id="igcyq"><label id="igcyq"><rt id="igcyq"></rt></label></blockquote><menu id="igcyq"></menu><tbody id="igcyq"><bdo id="igcyq"><blockquote id="igcyq"></blockquote></bdo></tbody></div> <!--癑ֺ地图容器--> <div style="width:100%;border:#ccc solid 1px;" id="dituContent"></div> <a href="http://www.nb-book.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"> //创徏和初始化地图函数Q? function initMap() { createMap();//创徏地图 setMapEvent();//讄地图事g addMapControl();//向地图添加控? addMarker();//向地图中dmarker } //创徏地图函数Q? function createMap() { var map = new BMap.Map("dituContent");//在百度地囑֮器中创徏一个地? var point = new BMap.Point(121.493046, 31.302575);//定义一个中心点坐标 map.centerAndZoom(point, 18);//讑֮地图的中心点和坐标ƈ地图显C在地图容器? window.map = map;//map变量存储在全局 } //地图事g讄函数Q? function setMapEvent() { map.enableDragging();//启用地图拖拽事gQ默认启?可不? map.disableScrollWheelZoom();//用地图滚轮攑֤~小Q默认禁?可不? map.disableDoubleClickZoom();//用鼠标双击攑֤ map.enableKeyboard();//启用键盘上下左右键移动地? } //地图控gd函数Q? function addMapControl() { } //标注Ҏl? var markerArr = [{ title: "上v凯司令食品股份有限公?, content: "售后服务热线Q?5175179<br/>公司地址 Q纪念\400?, point: "121.493123|31.302575", isOpen: 1, icon: { w: 23, h: 25, l: 46, t: 21, x: 9, lb: 12 } } ]; //创徏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>