6***@qq.com
6***@qq.com
  • 发布:2020-11-08 16:28
  • 更新:2023-01-28 17:12
  • 阅读:1368

【报Bug】版本更新到2.9.7后,uni.getLocation在IOS端无法获得address 已设置geocode: true

分类:uni-app

产品分类: uniapp/App

PC开发环境操作系统: Mac

PC开发环境操作系统版本号: 10.15.7

HBuilderX类型: 正式

HBuilderX版本号: 2.9.7

手机系统: iOS

手机系统版本号: IOS 14

手机厂商: 苹果

手机机型: iPhoneSE

页面类型: vue

打包方式: 云端

项目创建方式: HBuilderX

示例代码:

uni.getLocation({
type: 'gcj02',
geocode: true,
success: (res) => {
console.log(res);
console.log(res.address);
}
})

操作步骤:

新建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,
"accuracy": 68.86002867081368,
"errMsg": "getLocation:ok"
}

bug描述:

版本更新到2.9.7后,uni.getLocation在IOS端无法获得address 已设置geocode: true

2020-11-08 16:28 负责人:CLP 分享
已邀请:
H5_flymorn

H5_flymorn

问题一样,2.9.7版本。

uni.getLocation 已配置 geocode: true ,依然没有 address:

uni.getLocation({  
				    type: 'gcj02',  
					geocode: true,// 解析地址  
				    success: (res) => {  
				        console.log('当前位置', res);  
						let address = res.address;  
				    }  
				});

返回如下:

{  
	"type": "GCJ02",  
	"altitude": 9.439997673034668,  
	"latitude": 31.68337103949653,  
	"longitude": 120.3085202365451,  
	"speed": null,  
	"accuracy": 65,  
	"errMsg": "getLocation:ok"  
}  

希望官方及时修复。

2***@qq.com

2***@qq.com

顶楼,同样的问题,

DCloud_UNI_GSQ

DCloud_UNI_GSQ

旧版是否正常?

DCloud_iOS_XHY
  • 6***@qq.com (作者)

    map组件中的include-points属性设置后无效顺便也解决一下吧


    2020-11-10 10:25

钟先生

钟先生

此问题希望尽早及时处理,已对生产环境造成影响

终究会弄懂

终究会弄懂

这个问题解决了没?

  • 6***@qq.com

    解决了你就不会在这问了,哈哈。安卓有时候获取的address都是空的


    2023-06-16 16:22

要回复问题请先登录注册