按时付款撒
按时付款撒
  • 发布:2020-09-27 11:51
  • 更新:2020-09-27 18:49
  • 阅读:894

使用小程序sdk在android上定位很慢!!!

分类:uni-app

该配置的都配置了,根据官方帖描述小程序的sdk也可以用在app端的呀,为什么android的定位这么慢啊,31秒呀!测试了两台安卓机,小米4和vivo,小米连wifi时候定位时快时慢。vivo连wifi时候都是30秒才返回,连4g秒回。小程序和ios倒是没问题。是我写的有问题还是我配置有问题,求求官方给个反馈说明指导吧

这两种写法都有同样的问题!!

            //定位  
            getLocation() {  
                let _this = this;  
                var inter = setInterval(()=>{  
                    this.i += 1  
                },1000)  
                let amapPlugin = new amap.AMapWX({ key: this.mapKey }); //小程序的key:78a0a2601990***************  
                amapPlugin.getRegeo({  
                    success: (data) => {  
                        console.log('地理信息',data)  
                        console.log(this.i + '秒',)  
                        clearInterval(inter)  
                        let addressComponent = data[0].regeocodeData.addressComponent;  
                        if (!addressComponent.city.length) {  
                            _this.city = addressComponent.province  
                        } else {  
                            _this.city = addressComponent.city  
                        }  
                        _this.getList()  
                    },  
                    fail: function(e) {  
                        console.log('获取失败',e)  
                    }  
                });  
            },
                uni.getLocation({  
                    geocode:true,  
                    success: function (res) {  
                        _this.city = res.address.city  
                        _this.getList()  
                    },  
                    fail: function(e) {  
                        console.log('获取失败', e)  
                    }  
                });
2020-09-27 11:51 负责人:无 分享
已邀请:
DCloud_Android_ST

DCloud_Android_ST

SDK 什么版本,别说最新说版本号

按时付款撒

按时付款撒 (作者) - 啊实打实打算

官方最新版本19年11月的  
function AMapWX(a) {  
    this.key = a.key, this.requestConfig = {  
        key: a.key,  
        s: "rsx",  
        platform: "WXJS",  
        appname: a.key,  
        sdkversion: "1.2.0",  
        logversion: "2.0"  
    }  
}

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