Closed vgirik closed 6 days ago
cordova -v
cordova platform ls
#ready
INSERT_YOUR_CODE_HERE
BackgroundGeolocation.watchPosition( (location) => { console.log("[watchPosition] -", location); localStorage.setItem('locations', JSON.stringify(location.coords)); this.lat = location.coords.latitude; this.lan = location.coords.longitude; this.odometer = location.odometer console.log('odometer',this.odometer) this.data = this.data + this.odometer console.log('data',this.data) // localStorage.setItem('odometer',this.data.toString()); this.saveLocation(this.lat, this.lan); // if ((localStorage.getItem('StopInterval') === 'false' && localStorage.getItem('StopInterval'))) { // this.store_getCurrentPosition(); // } }, (errorCode) => { console.log('[watchPosition] ERROR -', errorCode); }, { interval: 7000, // location capture interval desiredAccuracy: BackgroundGeolocation.DESIRED_ACCURACY_HIGH, persist: true, timeout: 60000, } );
// BackgroundGeolocation Plugin configuration BackgroundGeolocation.ready( { reset: true, // debug: true, logLevel: BackgroundGeolocation.LOG_LEVEL_VERBOSE, desiredAccuracy: BackgroundGeolocation.DESIRED_ACCURACY_HIGH, //autoSync: true, stopOnTerminate: false, allowIdenticalLocations: false, persistMode: BackgroundGeolocation.PERSIST_MODE_LOCATION, }, (state) => { console.log('[ready] BackgroundGeolocation is ready to use'); if (!state.enabled) { BackgroundGeolocation.start(); } } ); }
Actual KMS : 5 KM
In one trip it came 58 kms In another trip it came 20 Kms
1. 2. 3. 4.
Please learn to Syntax highlight codeblocks.
This issue is stale because it has been open for 30 days with no activity.
This issue was closed because it has been inactive for 14 days since being marked as stale.
Your Environment
cordova -v
): 11.0.0cordova platform ls
): Android 10.1,2#ready
: ReadyBackgroundGeolocation.watchPosition( (location) => { console.log("[watchPosition] -", location); localStorage.setItem('locations', JSON.stringify(location.coords)); this.lat = location.coords.latitude; this.lan = location.coords.longitude; this.odometer = location.odometer console.log('odometer',this.odometer) this.data = this.data + this.odometer console.log('data',this.data) // localStorage.setItem('odometer',this.data.toString()); this.saveLocation(this.lat, this.lan); // if ((localStorage.getItem('StopInterval') === 'false' && localStorage.getItem('StopInterval'))) { // this.store_getCurrentPosition(); // } }, (errorCode) => { console.log('[watchPosition] ERROR -', errorCode); }, { interval: 7000, // location capture interval desiredAccuracy: BackgroundGeolocation.DESIRED_ACCURACY_HIGH, persist: true, timeout: 60000, } );
// BackgroundGeolocation Plugin configuration BackgroundGeolocation.ready( { reset: true, // debug: true, logLevel: BackgroundGeolocation.LOG_LEVEL_VERBOSE, desiredAccuracy: BackgroundGeolocation.DESIRED_ACCURACY_HIGH, //autoSync: true, stopOnTerminate: false, allowIdenticalLocations: false, persistMode: BackgroundGeolocation.PERSIST_MODE_LOCATION, }, (state) => { console.log('[ready] BackgroundGeolocation is ready to use'); if (!state.enabled) { BackgroundGeolocation.start(); } } ); }
Expected Behavior
Actual KMS : 5 KM
Actual Behavior
In one trip it came 58 kms In another trip it came 20 Kms
Steps to Reproduce
1. 2. 3. 4.
Context
Debug logs
Logs
``` PASTE_YOUR_LOGS_HERE ```