Baidu Map getCurrentPosition has a good chance of returning the result as null.

there is a 50% chance of returning an empty object, a probability and a result, so it won"t work.

< 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>

this kind of question you should go here and ask http://bbs.lbsyun.baidu.com/f.

.
Menu