有一半的几率都返回空的对象,有几率又有结果,这样用不了...
<script type="text/javascript" src="http://api.map.baidu.com/api?...;ak=QkxUkfoyrAVOF2mNqUOw9krqbXNx6IRL"></script>
<script type="text/javascript">
function bd_position() { //百度定位
var geolocation = new BMap.Geolocation();
geolocation.getCurrentPosition(function(r){
if(this.getStatus() == BMAP_STATUS_SUCCESS){
console.log(r.address);
}
else {
console.log('failed');
}
},{
enableHighAccuracy: true
})
}
</script>
这种问题你应该去这里问 http://bbs.lbsyun.baidu.com/f...