<!DOCTYPE HTML> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>根据经纬度获取地址信息</title> </head> <body> <script src="http://api.map.baidu.com/api?type=quick&ak=6skxCb028bqwS1gbAOKq85ER&v=1.0"></script> <script> // 百度地图API功能 var map = new BMap.Map("allmap"); var point = new BMap.Point(116.331398,39.897445); var gc = new BMap.Geocoder(); gc.getLocation(point, function(rs){ var addComp = rs.addressComponents; alert(addComp.province + ", " + addComp.city + ", " + addComp.district + ", " + addComp.street + ", " + addComp.streetNumber); }); </script> </body> </html>