现在出现了2个问题
-
如果type 为默认值 wgs84 有时候会导致我点击了没有任何反应 有时候又是点击了 触发十来秒后有反应 有时候又是可以秒反应这是什么原因造成的?
-
如果type为 gcj02 返回的坐标会是 一个负数的坐标轴,我配置了百度地图的定位 但是依然会这样
这些都是在APP上发生的
具体代码
uni.getLocation({
// type: 'gcj02',
success: res => {
console.log('开始定位', res)
uni.hideLoading()
const locationData = {}
locationData.latitude = res.latitude
locationData.longitude = res.longitude
resolve(locationData)
},
fail: (e) => {
console.log('定位报错拉 ', JSON.stringify(e))
// #ifdef MP-WEIXIN
uni.showModal({
title: '温馨提示',
content: '暂未获得您的位置信息授权,无法继续为您提供服务,请先允许我们获取您的位置信息!',
showCancel: false,
confirmText: '前往设置',
complete: () => {
uni.openSetting()
}
})
// #endif
reject()
},
complete: (e) => {
console.log('结束调用定位', e)
}
})
3***@qq.com (作者)
配置确认了是一致的。。而且我也只用到了定位 苹果上是可以的 安卓上不行
2022-11-14 08:51