Filtering out GPX positions when accuracy is less than 10 m
This commit is contained in:
1 parent
5404a6e5ad
commit
bf179a4b6d
1 file changed
+6
-3
@@ -42,7 +42,10 @@ const GpxRecord: Component<{}> = (props) => {
|
||||
location.time - globalThis.$lastValidLocationTime
|
||||
}`
|
||||
);
|
||||
if (location.time - globalThis.$lastValidLocationTime > 15000) {
|
||||
if (
|
||||
location.accuracy < 10 &&
|
||||
location.time - globalThis.$lastValidLocationTime > 15000
|
||||
) {
|
||||
globalThis.$lastValidLocationTime = location.time;
|
||||
await dispatch({
|
||||
action: 'appendTrkpt',
|
||||
@@ -87,7 +90,7 @@ const GpxRecord: Component<{}> = (props) => {
|
||||
const trkIdObj = getUri('trk', trkId);
|
||||
setTrksegId({ ...trkIdObj, trkseg: 0 });
|
||||
globalThis.$lastValidLocationTime = 0;
|
||||
const id = await startBackgroundGeolocation(newLocationHandler, 20);
|
||||
const id = await startBackgroundGeolocation(newLocationHandler, 10);
|
||||
setWatcherId(id);
|
||||
setState('recording');
|
||||
setOpen(false);
|
||||
@@ -99,7 +102,7 @@ const GpxRecord: Component<{}> = (props) => {
|
||||
};
|
||||
const resumeRecordingHandler = async () => {
|
||||
setTrksegId({ ...trksegId()!, trkseg: trksegId()!.trkseg + 1 });
|
||||
const id = await startBackgroundGeolocation(newLocationHandler, 20);
|
||||
const id = await startBackgroundGeolocation(newLocationHandler, 10);
|
||||
setWatcherId(id);
|
||||
setState('recording');
|
||||
setOpen(false);
|
||||
|
||||
Reference in new issue
Block a user