6***@qq.com
6***@qq.com
  • 发布:2019-09-11 19:23
  • 更新:2022-05-17 11:23
  • 阅读:952

【报Bug】ios 在uni.getLocation 的返回结果中,没有speed, 和 地址解析时信息不全

分类:uni-app

样例代码

                uni.getLocation({  
                    type: 'wgs84',  
                    geocode: true,  
                    success: function (res) {  
                        console.log(res);  
                });

在 Android 和 Ios 中运行结果
Android

{  
    "type": "wgs84",  
    "latitude": 31.230103281346825,  
    "longitude": 121.20186791780118,  
    "speed": 0,  
    "accuracy": 30,  
    "address": {  
        "country": "中国",  
        "province": "上海市",  
        "city": "上海市",  
        "district": "青浦区",  
        "street": "华南路",  
        "streetNum": "555号",  
        "poiName": "顺丰上海产业园",  
        "cityCode": "021"  
    },  
    "errMsg": "getLocation:ok"  
}  

Ios 运行结果如下( 6s 和 7 plus 的运行结果是一样的)
{
"type": "wgs84",
"latitude": 31.23014602706051,
"longitude": 121.2018999965201,
"speed": null, --- 这个数据没有获取到, 我是静止时测试的, 没有运动时测试过
"accuracy": 65,
"address": {
"city": "上海市",
"country": "中国",
"district": "青浦区",
"street": "华南路"
},
"errMsg": "getLocation:ok"
}

地址解析中缺少 province,streetNum, poiName , cityCode
我用的是高德地图, 然后对应的key 也填上去了

另外, type 写上wgs84 或是 gcj02 返回的都是 wgs84 , 这个也不知道是什么问题,

工具版本 2.2.2.20190816

2019-09-11 19:23 负责人:无 分享
已邀请:
ewpower

ewpower

请问解决了吗?

7***@qq.com

7***@qq.com

哎.........uniapp就是口号,多端发布,统一多端,实际多端运行结果不一样

瑞芝康健

瑞芝康健

请问解决了么

要回复问题请先登录注册