uni.getLocation({
//isHighAccuracy: true, // 开启地图精准定位
type: 'gcj02', // 坐标系类型
geocode: true,
success: function(res) {
console.log("address", res.address)
}
});

- 发布:2024-08-15 17:01
- 更新:2024-08-15 17:07
- 阅读:111
产品分类: uniapp/App
PC开发环境操作系统: Windows
PC开发环境操作系统版本号: Windows 10 家庭中文版
HBuilderX类型: 正式
HBuilderX版本号: 4.24
手机系统: HarmonyOS NEXT
手机系统版本号: HarmonyOS NEXT Developer Preview
手机厂商: 华为
手机机型: nova 11
页面类型: vue
vue版本: vue3
打包方式: 云端
项目创建方式: HBuilderX
操作步骤:
预期结果:
{
"country": "中国",
"province": "广东省",
"city": "广州市",
"district": "xx",
"street": "xx",
"streetNum": "xx",
"poiName": "xx",
"cityCode": "xx"
}
{
"country": "中国",
"province": "广东省",
"city": "广州市",
"district": "xx",
"street": "xx",
"streetNum": "xx",
"poiName": "xx",
"cityCode": "xx"
}
实际结果:
{
"country": "",
"province": "",
"city": "",
"district": "",
"street": "",
"streetNum": "",
"poiName": "",
"cityCode": ""
}
{
"country": "",
"province": "",
"city": "",
"district": "",
"street": "",
"streetNum": "",
"poiName": "",
"cityCode": ""
}
bug描述:
hbuilder升级到到4.24版本自定义基座运行uni.getLocation 中的 address 为空 但是4.15版本是正常的
迷你猩 (作者)
还是不行
2024-08-16 13:34
jgj_app
回复 迷你猩: 代码粘贴我看下
2024-08-16 13:36
迷你猩 (作者)
回复 jgj_app: 找到问题了,是打包的时候修改包名导致的,包名和生成高德的key的包名不一致。谢谢
2024-08-16 14:36