百度地图(反向地址解析即根据经纬度解析出具体的地址)

// 创建地址解析器实例
 var myGeo = new BMap.Geocoder();
 // 将地址解析结果显示在地图上,并调整地图视野

myGeo.getLocation(point, function(rs){
         var address = rs.addressComponents;
       var addr = "当前位置:" + address.province + ", " + address.city + ", " + address.district + ", " + address.street + ", " + address.streetNumber + "<br/>";

        var marker=new BMap.Marker(point,{title: i +1});//创建标注

        map.addOverlay(marker);//标注在地图上

});

相关推荐