Also remember to school when the bus query system, also listen to the teacher said can call Baidu Map API, but at that time do not know what is Baidu Map API, do not know exactly how to call, this thing has been in mind, work is not willing to touch this piece of, think it should be difficult, Recently want to explore, so put your own experience record it. First in Baidu to apply for a key link Http://lbsyun.baidu.com/apiconsole/key
Call Baidu map <script type= "Text/javascript" src= "Http://api.map.baidu.com/api?v=2.0&ak=key" ></script>
Reference Baidu Map Demo Http://developer.baidu.com/map/jsdemo.htm#a1_2
Html
<div style="width:800px;height:600px;margin:5px auto" id="allmap "></div>
JS Add Callout
varMap =NewBmap.map ("Allmap");//Baidu Map API featuresvarMyicon =NewBmap.icon ("Http://www.luyou666.com/content/images/map_icon.png",NewBmap.size ( -, *));//Callout IconvarPoint =NewBmap.point (Lng,lat);//Set Center point coordinatesvarMarker =NewBmap.marker (Point, {icon:myicon});//Create a calloutMap.addoverlay (marker);//add a callout to a mapMarker.setanimation (bmap_animation_bounce);//Bouncing AnimationsMap.centerandzoom (Point, the);//initialize map, set center point coordinates and map levelMap.addcontrol (NewBmap.maptypecontrol ());//Add a Map type controlMap.enablescrollwheelzoom (true);//Turn on mouse wheel zoom
Baidu Map API