5***@qq.com
5***@qq.com
  • 发布:2019-10-10 17:56
  • 更新:2019-10-10 22:39
  • 阅读:1713

【报Bug】关于GeoLocation定位不准问题

分类:uni-app

详细问题描述

使用plus 获取当前位置。provider值改变,始终wifi或热点获取值的正常。使用自身手机数据流量永远有偏差。获取不正确 求大神解决下

[内容]

重现步骤

[步骤]

<map class="route-map" style="margin-top:10upx;height:500px;width: 368px;" :latitude="location.coords.latitude||''" :longitude="location.coords.longitude||''" :markers="covers||''" ></map>

locations:function(){
// #ifdef APP-PLUS
plus.geolocation.getCurrentPosition((res)=>{
this.location=res;
this.targetlocation=this.location;
this.covers[0].latitude=this.location.coords.latitude;
this.covers[0].longitude=this.location.coords.longitude;
console.log(this.location.coords.latitude+','+this.location.coords.longitude);
this.distance=this.getDistance(this.location);
},(err)=>{
console.log(err)
uni.hideLoading();
},{enableHighAccuracy:true,provider:'amap',coordsType:'gcj02'})//gcj02坐标系 地址错误

              plus.geolocation.watchPosition((p)=>{//监听位置  
                 this.location=p;  
                  this.distance=this.getDistance(this.location);  
                  this.covers[0].latitude=this.location.coords.latitude;  
                  this.covers[0].longitude=this.location.coords.longitude;  
                }, function(e){  
                    console.log('Geolocation error: ' + e.message);  
                },{enableHighAccuracy:true,provider:'amap',coordsType:'gcj02'});  
            // #endif  

}
[结果]

[期望]

[如果语言难以表述清晰,拍一个视频或截图,有图有真相]

IDE运行环境说明

[HBuilder 或 HBuilderX。如果你用其他工具开发uni-app,也需要在此说明]
HBuilderX
[IDE版本号]

[windows版本号]

[mac版本号]

uni-app运行环境说明

[运行端是h5或app或某个小程序?]
app
[运行端版本号]

[项目是cli创建的还是HBuilderX创建的?如果是cli创建的,请更新到最新版cli再试]
HBuilderX
[编译模式是老模板模式还是新的自定义组件模式?]
自定义组件模式

App运行环境说明

[Android版本号]

[iOS版本号]

[手机型号]
小米6
[模拟器型号]

附件

[IDE问题请提供HBuilderX运行日志。菜单帮助-查看运行日志,点右键打开文件所在目录,将log文件压缩成zip包上传]

[App问题请提供可重现问题的代码片段,你补充的细一点,问题就解决的快一点]

[App安装包或H5地址]

[可重现代码片段]

联系方式

[QQ]

2019-10-10 17:56 负责人:无 分享
已邀请:
DCloud_heavensoft

DCloud_heavensoft

这不是bug,你可以试试其他软件是否一样。
如果你的手机关闭了gps,手机会依赖基站位置和wifi热点位置综合计算你的位置。
如果连wifi也关了,那就是基站的位置。

  • 5***@qq.com (作者)

    我也用检测GPS检测过了 手机GPS是开启的也授权了。

    2019-10-11 08:00

  • 5***@qq.com (作者)

    而且你说是基站的问题。我移动 它也会相对移动 。不可能基站会移动吧

    2019-10-11 08:04

  • DCloud_heavensoft

    回复 5***@qq.com: 你移动后,手机被另一个基站接管了呗。如果gps开启了,那可能是gps没信号

    2019-10-11 13:45

  • 5***@qq.com (作者)

    回复 DCloud_heavensoft: 你说的都对 但是还是没办法解决呀

    2019-10-11 18:02

  • DCloud_heavensoft

    回复 5***@qq.com: 对啊,所有软件都这样

    2019-10-11 20:14

  • 5***@qq.com (作者)

    回复 DCloud_heavensoft: uni.chooseLocation() 的位置确实正确的。我能获取chooseLocation里面的坐标么?

    2019-10-14 15:32

该问题目前已经被锁定, 无法添加新回复