Alysaa
Alysaa
  • 发布:2022-05-23 16:47
  • 更新:2022-12-22 18:26
  • 阅读:1392

H5端 uni.getLocation定位不准确,相差了30多公里

分类:uni-app

uni.getLocation定位不正常,相差了30多公里

uni.getLocation({
isHighAccuracy: true,
success(res) {
// console.log('首次获取当前位置成功', res.longitude, res.latitude)
const { longitude, latitude } = res
saveUserLocation(res)
},
fail(res) {
saveUserLocation('')
console.log('获取当前位置失败', res)
},
})

2022-05-23 16:47 负责人:无 分享
已邀请:
FullStack

FullStack - 【插件开发】【专治疑难杂症】【ios上架、马甲包、白包、过审、已成功上架过几百个】【多款插件已上架:https://ext.dcloud.net.cn/publisher?id=22130】【非诚勿扰】QQ:543610866

h5端,定位本来就不准,用app吧

3***@qq.com

3***@qq.com

                  uni.getLocation({  
                    type:"gcj02",  
                    success:res=>{  
                        console.log('接口调用成功',res);  
                        this.longitude=res.longitude  
                        this.latitude=res.latitude  
                    },  
                    fail: (error) => {  
                        console.log('接口调用失败',error);  
                    },  

                })  

定位相差非常大 人在福州定位在北京王府井附近

1***@qq.com

1***@qq.com

解决了吗?我h5本地调试准确,打包部署后就不准了

要回复问题请先登录注册