jeawy
jeawy
  • 发布:2021-03-12 19:27
  • 更新:2022-06-06 17:35
  • 阅读:1495

【报Bug】plus.geolocation.getCurrentPosition返回很慢,大概需要10秒左右

分类:uni-app

产品分类: uniapp/App

PC开发环境操作系统: Windows

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

HBuilderX类型: 正式

HBuilderX版本号: 3.1.4

手机系统: iOS

手机系统版本号: iOS 13.1

手机厂商: 苹果

手机机型: iphone11

页面类型: nvue

打包方式: 云端

项目创建方式: HBuilderX

示例代码:

plus.geolocation.getCurrentPosition(
({
coords
}) => {
const LOCATION = {
longitude: coords.longitude,
latitude: coords.latitude
};
console.log("2.2")
this.mapCenter = LOCATION;
console.log("2.3")

                },  
                err => {  
                    this.errorMessage = `${err.code}:${err.message}`;  
                    console.log("2.4")  
                    console.log(this.errorMessage)  
                }, {  
                    enableHighAccuracy: true,  
                    geocode: false  
                }  
            );

操作步骤:

plus.geolocation.getCurrentPosition(
({
coords
}) => {
const LOCATION = {
longitude: coords.longitude,
latitude: coords.latitude
};
console.log("2.2")
this.mapCenter = LOCATION;
console.log("2.3")

                },  
                err => {  
                    this.errorMessage = `${err.code}:${err.message}`;  
                    console.log("2.4")  
                    console.log(this.errorMessage)  
                }, {  
                    enableHighAccuracy: true,  
                    geocode: false  
                }  
            );

预期结果:

预期一秒内返回

实际结果:

10秒才返回

bug描述:

plus.geolocation.getCurrentPosition 带enableHighAccuracy: true和geocode: false参数的时候,返回经纬度很慢,大概需要10秒,如果不带这两个参数,大概一秒内返回了。
Hbuild3 之前的版本不是这样的,无论是否带这个参数都会很快返回。

2021-03-12 19:27 负责人:无 分享
已邀请:
z***@hotmail.com

z***@hotmail.com

我这边也是这样的问题,每次定位都要10秒才能出来,请问你那边解决了吗

y***@youjiuzs.com

y***@youjiuzs.com

我啥参数都没有,就一个返回成功函数,结果返回也特别慢,也是ios,安卓贼快,楼主解决了么

1***@qq.com

1***@qq.com

我去,这是通病吧。搞了一天

要回复问题请先登录注册