984aca5bc78b070e59f34e230f11cf6dhttp://api.map.baidu.com/api?v=2.0&ak= your Key "Body, HTML {width:100%;height:100%;margin:0;font-family: "Microsoft Jas Black"; font-family: "Microsoft Black";} #allmap{width:100%;height:500px;}p{margin-left:5px; Font-size:14px;} </style> <script type= "Text/javascript" src= "http://api.map.baidu.com/api?v=2.0&ak= Your Keys" ></ Script> <title> Maps Click events </title>//Baidu Map API features varMap =NewBmap.map ("Allmap"); Map. Centerandzoom (NewBmap.point (116.404, 39.915), 11); functionShowinfo (e) {alert (e. POINT.LNG + "," + e.point.lat); } Map. AddEventListener ("click",showinfo);</script>
<divclass= "Fitem" > <divclass= "Ftitle" > Venue address <spanclass= "Bi" >*</span></div> <input name= "stadium_address" type= "text"class= "text" size= "/> </div> <div"class= "Fitem" > <divclass= "Ftitle" > Geographical location Longitude <spanclass= "Bi" >*</span></div> <input name= "longitude" id= "longitude" type= "text"class= "text" size= "/> </div> <div"class= "Fitem" > <divclass= "Ftitle" > Geographical latitude <spanclass= "Bi" >*</span></div> <input name= "latitude" id= "latitude" type= "text"class= "text" size= "/> </div> <div"class= "Fitem" > <input name= "map_search" id= "Map_search" type= "text"class= "text" size= "/> <input name=" search "id=" search "type=" button "value=" Search "/> <div id=" all Map "></div> </div>
//Baidu Map API features varMap =NewBmap.map ("Allmap"); Map. Centerandzoom (NewBmap.point (114.068, 22.5469), 13); $("#search"). Click (function(){ varplace=$ (' #map_search ').Val (); varLocal =NewBmap.localsearch (Map,{renderoptions: {map:Map}}); Local.Search (place); }); Map. Enablescrollwheelzoom (true);//Turn on mouse wheel zoom functionShowinfo (e) {document. getElementById ("longitude"). Value=e.point.LNG; Document. getElementById ("latitude"). Value=e.point.lat; //Map.addoverlay (New Bmap.marker (New Bmap.point (E.point.lng,e.point.lat)));Map.clearoverlays (); varNew_point =NewBmap.point (E.point.lng,e.point.lat); varMarker =NewBmap.marker (New_point);//Create a calloutMap.addoverlay (marker);//add a callout to a mapMap.panto (new_point); //Alert (e.point.lng + "," + E.point.lat);} map. AddEventListener ("click", Showinfo);
Baidu Map API Features