1***@qq.com
1***@qq.com
  • 发布:2024-05-10 17:20
  • 更新:2024-09-25 13:57
  • 阅读:593

【报Bug】uni.getLocatio() api type: 'gcj02',定位报 getLocation:fail not support gcj02

分类:uni-app

产品分类: uniapp/App

PC开发环境操作系统: Windows

PC开发环境操作系统版本号: 21H2(OS 内部版本 22000.2538)

HBuilderX类型: 正式

HBuilderX版本号: 4.15

手机系统: Android

手机系统版本号: Android 11

手机厂商: 小米

手机机型: 红米

页面类型: vue

vue版本: vue3

打包方式: 云端

项目创建方式: HBuilderX

示例代码:

//定位
gps() {
// console.log('获取当前位置')
uni.showLoading({
title: '获取位置中',
mask: true
})
let __this = this;
uni.getLocation({
type: 'gcj02',
isHighAccuracy: true, // 是否高精度获取
highAccuracyExpireTime: 3000,
timeout: '3',
cacheTimeout: 3,
accuracy: 'best',
success: function(res) {
console.log(res, '会计法艰苦撒旦发')

                },  
                fail(erro) {  
                    console.log(erro, '111会计法艰苦撒旦发')  

                },  
            });  
        },

操作步骤:

直接调用就行

预期结果:

获取经纬度

实际结果:

"errMsg":"getLocation:fail not support gcj02","errCode":18,"code":18

bug描述:

uni.getLocatio() api type: 'gcj02',定位报 getLocation:fail not support gcj02,我们配置了高德地图的key

2024-05-10 17:20 负责人:无 分享
已邀请:
z***@163.com

z***@163.com

看了这个的帖子https://ask.dcloud.net.cn/question/173880,加上这个geolocation-amap-release.aar包就好了

要回复问题请先登录注册