如题,获取当前定位,返回的是城市中心点坐标。
不是坐标转换的误差。手机定位已开,定位权限也给了。
新手没有C币。。
function getCurAddress() {
var geolocation = new BMap.Geolocation();
geolocation.getCurrentPosition(function(r){
if(this.getStatus() == BMAP_STATUS_SUCCESS){
center = r.point;
} else alert('failed'+this.getStatus());
})
}
附上相关API: