2***@qq.com
2***@qq.com
  • 发布:2024-03-06 16:26
  • 更新:2024-03-06 16:26
  • 阅读:135

【报Bug】uni.getLocation 使用 type: "gcj02" 报错

分类:uni小程序sdk

产品分类: uni小程序SDK

手机系统: iOS

手机系统版本号: iOS 17

手机厂商: 苹果

手机机型: iPhone 12

页面类型: vue

SDK版本号: 3.9.9

操作步骤:

uni.getLocation({
type: "gcj02",
geocode: true,
success: function (res) {
console.log(res)
},
fail: (err) => {
uni.showToast({
title:'定位失败',
icon:"none",
})
console.log(JSON.stringify(err))
}
});

预期结果:

可正常返回定位信息

实际结果:

报错 jsLog: {"errMsg":"getLocation:fail getLocation:fail Not Support CoordsType,https://ask.dcloud.net.cn/article/282"} at components/zl-map/zl-map.vue:164

bug描述:

uni.getLocation({  
        type: "gcj02",  
        geocode: true,  
        success: function (res) {  
            console.log(res)  
        },  
        fail: (err) => {  
            uni.showToast({  
                title:'定位失败',  
                icon:"none",  
            })  
            console.log(JSON.stringify(err))  
        }  
    });

在 uni 代码中使用以上方法 ios 中返回错误

jsLog: {"errMsg":"getLocation:fail getLocation:fail Not Support CoordsType,https://ask.dcloud.net.cn/article/282"} at components/zl-map/zl-map.vue:164

请问如何处理
type: "gcj02",不传的话可以获取到位置 但在搞得地图中渲染是偏离的

2024-03-06 16:26 负责人:无 分享
已邀请:

要回复问题请先登录注册