<meta http-equiv= "Content-type" content= "text/html; charset=gb2312 ">
<script type= "Text/javascript" src= "./jquery-1.4.2.min.js" ></script>
<!--here the difference between AK and no AK is not clear yet.
<script type= "Text/javascript" src= "Http://api.map.baidu.com/api?v=2.0&ak=Wb3W4PL5khQp9GS6Gm6HIdW7" > </script>
-
<script type= "Text/javascript" src= "http://api.map.baidu.com/api?v=3.0" ></script>
<script type= "Text/javascript" >
function Test1 () {
112.881885, 28.220368
var la = $ ("#la"). Val ();
var lo = $ ("#lo"). Val ();
if (la== "" | | lo== "") {
Alert ("Latitude and longitude cannot be empty!") ");
Return
}
Alert (la+ "," +lo);
var gc = new Bmap.geocoder ();
var map = new Bmap.map ("container");
var pt = new Bmap.point (LA, lo);
Gc.getlocation (PT, function (RS) {
var addcomp = rs.addresscomponents;
Alert (addcomp.province + "," + addcomp.city + "," + Addcomp.district + "," + Addcomp.street + "," + addcomp.streetnumb ER);
});
}
</script>
<body>
<center>
<div style= "margin-top:100px" >
Test case: Longitude: 112.881885, Latitude: 28.220368; Address: Hunan Province, Changsha, Yuelu District, Valley Garden Road, No. 186th
<br/><br/><br/>
Longitude: <input type= "text" id= "La" value= "112.881885"/>
Latitude: <input type= "text" id= "Lo" value= "28.220368"/>
<input type= "button" id= "Test" onclick= "Test1 ()" value= "point I get Location"/>
</div>
</center>
</body>
Baidu Map Anti-address resolution (through Latitude query address information)