问题描述
这是我的代码:
async getGridPointApiUrl() {
const position = await this.getPosition();
let latitude = position.coords.latitude;
let longitude = position.coords.longitude;
console.log([latitude,longitude,position.coords.accuracy]);
}
getPosition() {
return new Promise((resolve,reject) => {
navigator.geolocation.getCurrentPosition(
resolve,reject,{
maximumAge: 0,timeout: Infinity,enableHighAccuracy: true
});
});
}
运行此命令时,我的精度为5米。没办法吧!返回的坐标距离很好10英里。虽然enableHighAccuracy
是否为false,但我得到的结果相同。那应该发生吗?我正在基于Chromium的Brave Browser上进行测试。
我决定在Firefox上检查相同的代码,等等,返回的坐标要好得多,并且准确性似乎正确。但是,布尔enableHighAccuracy
同样也不会影响Firefox中显示的准确性。
我在这里想念什么吗?有没有办法使Brave上的准确性至少与Firefox一样好?
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)