uni-app中uni.getLocation获取不到Address字段
uni-app中uni.getLocation获取不到Address字段
| 字段 | 值 |
|---|---|
| 产品分类 | uniapp/App |
| PC开发环境操作系统 | Windows |
| PC开发环境操作系统版本号 | Windows 10 专业版 19042.1466 |
| HBuilderX类型 | 正式 |
| HBuilderX版本号 | 3.3.11 |
| 手机系统 | Android |
| 手机系统版本号 | Android 10 |
| 手机厂商 | 小米 |
| 手机机型 | 红米 note 11 |
| 页面类型 | vue |
| vue版本 | vue2 |
| 打包方式 | 云端 |
| 项目创建方式 | HBuilderX |
操作步骤:
uni.getLocation({
'type': 'wgs84',
'geocode':'true',
success: function(res) {
console.log(res)
},
});
预期结果:
{
"type": "wgs84",
"altitude": 0,
"latitude": 30.570937,
"longitude": 104.058364,
"speed": 0,
"accuracy": 29,
"errMsg": "getLocation:ok",
address:{
province:''
。。。。。等等
}
}
实际结果:
{
"type": "wgs84",
"altitude": 0,
"latitude": 30.570937,
"longitude": 104.058364,
"speed": 0,
"accuracy": 29,
"errMsg": "getLocation:ok"
}
bug描述:
uni.getLocation({
'type': 'wgs84',
'geocode':'true',
success: function(res) {
console.log(res)
},
});
返回结果
{
"type": "wgs84",
"altitude": 0,
"latitude": 30.570937,
"longitude": 104.058364,
"speed": 0,
"accuracy": 29,
"errMsg": "getLocation:ok"
}
缺少**address**字段,以前是有的 ,以前是魅族手机上测的,现在魅族手机坏了,换成红米,
更多关于uni-app中uni.getLocation获取不到Address字段的实战教程也可以访问 https://www.itying.com/category-93-b0.html
2 回复
address仅App平台支持(安卓需指定type 为 gcj02 并配置三方定位SDK)
更多关于uni-app中uni.getLocation获取不到Address字段的实战教程也可以访问 https://www.itying.com/category-93-b0.html
谢谢

