Android 你能得到准确的位置吗
最近,我使用react native开发了一个定位模块,试图通过。但问题是,我不能得到准确的位置与GPS上 演示: 该方法的精度范围为10米至200米,不符合要求。 我想知道是否有任何建议来提高这种方法的准确性?或者有没有其他方法可以在react native中获得准确的位置Android 你能得到准确的位置吗,android,react-native,geolocation,positioning,Android,React Native,Geolocation,Positioning,最近,我使用react native开发了一个定位模块,试图通过。但问题是,我不能得到准确的位置与GPS上 演示: 该方法的精度范围为10米至200米,不符合要求。 我想知道是否有任何建议来提高这种方法的准确性?或者有没有其他方法可以在react native中获得准确的位置 let Timer; export default class XXX extends Component { componentDidMount() { timer = setInterval(t
let Timer;
export default class XXX extends Component {
componentDidMount() {
timer = setInterval(this.getLocation,8000);
}
getLocation() {
Geolocation.getCurrentPosition(
location => {
let result = "longitude :" + location.coords.longitude +
"\nlatitude:" + location.coords.latitude;
alert(result);
},
error => {
alert("failed to positioning:"+ error);
}
);
}
onBackAndroid = () => {
if (this.lastBackPressed && this.lastBackPressed + 2000 >= Date.now()) {
return false;
}
clearInterval(timer);
return true;
};
}