Bootstrap

uni.getLocation(Object)获取经纬度和当前中文地址

1.uni.getLocation({
                        type: 'wgs84',
                        //geocode:true,   //手机获取详细地址
                        success: (res)=> {
                        console.log('当前位置的经度:' + res.longitude);
                        console.log('当前位置的纬度:' + res.latitude);
                        console.log("当前位置中文" + res.address);
                        this.x = res.longitude
                        this.y = res.latitude
                        console.log(res.address)
                        this.address = res.address
                        console.log(this.x)
                        console.log(this.y)
                        // sessionStorage.setItem("sessionlongitude", this.x)
                        }

2.为了看到获取的经纬度和具体地址,要在网页上打上花括号

经度: { {

;