HTML part of the code
<div class= "MaxWidth" > <div class= "Address Clearfix" > <div class= "Map-box fl" > < Div id= "Allmap" ></div> </div> <div class= "MapTitle fr" > <span> Construction and Plastic Materials Co., Ltd. </span> <p> Contact: Mr. Hu </p> <p> e-mail: [Email protected]</p> <p> Address: Dongguan 5/F </p> <div class= "Qqinline" > <a href= "#" >QQ Online Consulting </a> < /div> </div> <div class= "mapimg fr" > </div> </div> <div class=" Hot "> </div> </div>
CSS Part code
. maxwidth{width:1200px;margin:0px Auto;} /* Map */ . Map-box{background-color: #fff; width:750px;height:538px;border:1px solid #eee;} #allmap {width:730px;height:518px;margin:10px;} Span. Bmap_marker label. bmaplabel{border:1px solid #000;border-radius:3px;} /* Map End */
JS Section Code
<script src= ". /js/jquery.min.js "></script> <script type=" Text/javascript "src=" http://api.map.baidu.com/api?ak= nbawc69hb3sgkdghko1hwhsp&v=2.0 "></script> <script type=" Text/javascript ">//Baidu Map API features varMap =NewBmap.map ("Allmap"); varPoint =NewBmap.point (113.732756,22.992607); Map.centerandzoom (Point,19); varMarker =NewBmap.marker (point);//Create a calloutMap.addoverlay (marker);//add a callout to a map varLabel =NewBmap.label ("Jian He Plastic Materials Co., Ltd.", {offset:NewBmap.size (20,-10)}); Label.setstyle ({bordercolor:"Black" }); //Marker.addeventlistener ("click", Function () {//click Popup to remove CommentsMarker.setlabel (label);//Open Information window //}); Click Eject to remove the comment</script>
As follows:
Write the map giant useful address mark:
Baidu Map Generator
Http://api.map.baidu.com/lbsapi/creatmap/index.html
Baidu Map Pickup coordinate system
Http://api.map.baidu.com/lbsapi/getpoint/index.html
Baidu map JavaScript API
Http://lbsyun.baidu.com/index.php?title=jspopular
Application of Baidu Map Api-javascript-web map