API Documentation: Http://developer.baidu.com/map/jshome.htm
But the description is not detailed enough, here is a complete example of traversing the search results.
(1) Here need to quote Baidu Map API, official documents
<title> Baidu map </title>
(2) Define the page elements that save the map
</body>
The
(3) Creates a map object and initializes it, and initialization is necessary, otherwise no action can be made.
<script type= "Text/javascript" > var ls = new Bmap.localsearch (map);
function Onsearchcomplete (result) {var n = Result.getnumpois ()) that defines the completion of each page results load
var tab = document.getElementById ("Courtlist");
var msg = document.getElementById ("errmsg");
var i = 0;
for (i = 0; i < Result.getcurrentnumpois (); i++) {var tr = tab.insertrow (tab.rows.length);
var poi = Result.getpoi (i);
Tr.insertcell (0). innertext = i + ls.getpagecapacity () * Result.getpageindex ();
Tr.insertcell (1). innertext = Poi.title;
Tr.insertcell (2). innertext = POI.POINT.LNG;
Tr.insertcell (3). innertext = Poi.point.lat;
Tr.insertcell (4). innertext = Poi.phonenumber;
Tr.insertcell (5). innertext = poi.address;
Tr.insertcell (6). innertext = Poi.tags;
//Judge whether to the last page, if yes then no longer search if (Result.getpageindex () < Result.getnumpages ()-1) Ls.gotopage (Result.getpageindex () + 1);
} ls.setsearchcompletecallback (Onsearchcomplete);
Ls.setpagecapacity (100);
Ls.search ("key Words"); </script>
(4) Define search. When the Localsearch.search method is invoked, only the results of the first page are given, and if the subsequent lookup must be retrieved using Localsearch.gotopage, the callback function will be invoked for each page result load completion