定位经常失败,尤其是第一次安装APP的时候,十次有3次都是失败,有没有什么优化方式,超时的时间也很长
{“code”:3301200,“message”:“BussinessError 3301200: Failed to obtain the geographical location.”}
let requestInfo:geoLocationManager.CurrentLocationRequest = { 'priority': geoLocationManager.LocationRequestPriority.LOW_POWER, 'maxAccuracy': 4 };
定位失败的原因主要是因为 maxAccuracy 设置的太小了,导致定位坐标被认定为不符合要求而被忽略,可以尝试改大一些,比如 100,经测试第一次定位 1s左右,后面每次都是几十毫秒