uni.getLocation({
// #ifdef APP-PLUS || MP-WEIXIN
type: 'gcj02',
// #endif
geocode: true,
success: async res => {
console.log(res);
},
complete: () => {
console.log('complete');
},
});
产品分类: uniapp/App
PC开发环境操作系统: Windows
PC开发环境操作系统版本号: win10
HBuilderX类型: 正式
HBuilderX版本号: 4.29
手机系统: Android
手机系统版本号: Android 13
手机厂商: 华为
手机机型: nova 9 rpo
页面类型: vue
vue版本: vue3
打包方式: 离线
项目创建方式: HBuilderX
uni.getLocation({
// #ifdef APP-PLUS || MP-WEIXIN
type: 'gcj02',
// #endif
geocode: true,
success: async res => {
console.log(res);
},
complete: () => {
console.log('complete');
},
});
-
address信息返回完整
address信息返回完整
{
"type": "gcj02",
"altitude": 0,
"latitude": 22.64003582769806,
"longitude": 114.07891400069764,
"speed": 0,
"accuracy": 30,
"address": {
"country": "",
"province": "",
"city": "",
"district": "",
"street": "",
"streetNum": "",
"poiName": "",
"cityCode": ""
},
"errMsg": "getLocation:ok"
}
调用uni.getLocation 设置了type:'gcj02',geocode:true address信息返回全部为空
1 个回复
朱小
确定配置了腾讯apikey或高德的key,然后重新打包了?