Add an event listener to the map, AddEventListener;
When the mouse clicks on the map, first get the pity dorado coordinates, and then add a red callout at the pity Dorado coordinates.
<!DOCTYPE HTML><HTML><Head> <Metaname= "Viewport"content= "initial-scale=1.0, User-scalable=no" /> <Metahttp-equiv= "Content-type"content= "text/html; charset=utf-8" /> <Scripttype= "Text/javascript"src= "http://api.map.baidu.com/api?v=1.4"></Script> <Scripttype= "Text/javascript"src= "Http://api.map.baidu.com/library/TextIconOverlay/1.2/src/TextIconOverlay_min.js"></Script> <Scripttype= "Text/javascript"src= "Http://api.map.baidu.com/library/MarkerClusterer/1.2/src/MarkerClusterer_min.js"></Script> <Scripttype= "Text/javascript"src= "Http://api.map.baidu.com/library/LuShu/1.2/src/LuShu_min.js"></Script> <title>26.1 adding annotations</title></Head><Body> <Divclass= "wrapper"> <Divclass= "Container Clearfix"> <Divclass= "Clearfix"> <Divstyle= "Clear:both;"> <Divstyle= "float:left; width:500px; height:340px; border:1px solid Gray"ID= "Container"> </Div> </Div> </Div> </Div> </Div></Body></HTML><Scripttype= "Text/javascript"> varMap= NewBmap.map ("Container"); var Point= NewBmap.point (116.404, 39.950507); Map.centerandzoom (Point, -); Map.addeventlistener ("Click", function(e) { point= NewBmap.point (E.POINT.LNG, E.point.lat); varMarker= NewBmap.marker (point); Map.addoverlay (marker); }); </Script>
Baidu Map Add Callout