uni.getLocation({
type: 'gcj02',
geocode: true,
success: (res) => {
console.log(res);
console.log(res.address);
}
})
- 发布:2021-04-10 21:48
- 更新:2021-04-12 23:26
- 阅读:471
产品分类: uniapp/App
PC开发环境操作系统: Windows
PC开发环境操作系统版本号: Windows 10
HBuilderX类型: 正式
HBuilderX版本号: 3.1.8
手机系统: iOS
手机系统版本号: IOS 14
手机厂商: 苹果
手机机型: iPhone7
页面类型: nvue
打包方式: 云端
项目创建方式: HBuilderX
示例代码:
操作步骤:
新建vue页面在onReady方法中查询定位信息
新建vue页面在onReady方法中查询定位信息
预期结果:
{
"type": "GCJ02",
"altitude": 415.9051151275635,
"latitude": 34.20214870876736,
"longitude": 108.8988245985243,
"speed": null,
"address":{
"poiName":"",
"street":"",
"streetNum":"",
"province":"",
"city":"",
"district":""
}
"accuracy": 68.86002867081368,
"errMsg": "getLocation:ok"
}
{
"type": "GCJ02",
"altitude": 415.9051151275635,
"latitude": 34.20214870876736,
"longitude": 108.8988245985243,
"speed": null,
"address":{
"poiName":"",
"street":"",
"streetNum":"",
"province":"",
"city":"",
"district":""
}
"accuracy": 68.86002867081368,
"errMsg": "getLocation:ok"
}
实际结果:
{
"type": "GCJ02",
"altitude": 415.9051151275635,
"latitude": 34.20214870876736,
"longitude": 108.8988245985243,
"speed": null,
"accuracy": 68.86002867081368,
"errMsg": "getLocation:ok"
}
{
"type": "GCJ02",
"altitude": 415.9051151275635,
"latitude": 34.20214870876736,
"longitude": 108.8988245985243,
"speed": null,
"accuracy": 68.86002867081368,
"errMsg": "getLocation:ok"
}
bug描述:
版本更新到3.1.8后,uni.getLocation在IOS端无法获得address 已设置geocode: true
1 个回复
DCloud_UNI_Anne
IOS13.6.1,iPhone 6s Plus测试,未复现问题。