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

- 发布:2024-03-06 16:26
- 更新:2024-03-06 16:26
- 阅读:668
产品分类: uni小程序SDK
手机系统: iOS
手机系统版本号: iOS 17
手机厂商: 苹果
手机机型: iPhone 12
页面类型: vue
SDK版本号: 3.9.9
操作步骤:
预期结果:
可正常返回定位信息
可正常返回定位信息
实际结果:
报错 jsLog: {"errMsg":"getLocation:fail getLocation:fail Not Support CoordsType,https://ask.dcloud.net.cn/article/282"} at components/zl-map/zl-map.vue:164
报错 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",不传的话可以获取到位置 但在搞得地图中渲染是偏离的
0 个回复