function showPosition(position){
lat=position.coords.latitude;
lon=position.coords.longitude;
//var map = new BMap.Map("container"); // 创建Map实例
var point = new BMap.Point(lon, lat); // 创建点坐标
//map.centerAndZoom(point,15); //
//map.enableScrollWheelZoom();
var gc = new BMap.Geocoder();
gc.getLocation(point, function(rs){
var addComp = rs.addressComponents;
alert(addComp.province + ", " + addComp.city + ", " + addComp.district + ", " + addComp.street);
});
}
</script>
</body>
</html>
新闻热点
疑难解答