@wemap/positioning 2.3.4 → 2.3.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -81,5 +81,5 @@
81
81
  "lint": "eslint --ext .js,.jsx --quiet src",
82
82
  "test": "mocha -r esm \"src/**/*.spec.js\""
83
83
  },
84
- "version": "2.3.4"
84
+ "version": "2.3.6"
85
85
  }
@@ -73,7 +73,7 @@ class GnssWifiPdrProvider extends MapMatchingProvider {
73
73
  * @override
74
74
  */
75
75
  stop() {
76
- this.imuProvider.stop();
76
+ this.pdrProvider.stop();
77
77
  this.gnssWifiProvider.stop();
78
78
  this.absoluteAttitudeProvider.stop();
79
79
  }
@@ -1,7 +1,7 @@
1
1
  import noop from 'lodash.noop';
2
2
 
3
3
  import {
4
- Constants as GeoConstants, Itinerary, WGS84UserPosition
4
+ Constants as GeoConstants, Itinerary, WGS84UserPosition, WGS84
5
5
  } from '@wemap/geo';
6
6
  import {
7
7
  rad2deg, Quaternion
@@ -128,14 +128,21 @@ class PdrProvider extends MapMatchingProvider {
128
128
  }
129
129
 
130
130
  setPosition(position) {
131
- this.pdrPosition = position;
131
+ if (position instanceof WGS84) {
132
+ this.pdrPosition = WGS84UserPosition.fromWGS84(position);
133
+ if (window && window.performance) {
134
+ this.pdrPosition.time = window.performance / 1e3;
135
+ }
136
+ } else {
137
+ this.pdrPosition = position;
138
+ }
132
139
 
133
140
  if (this.options.smoother) {
134
- this.smoother.generateNextPositions(position, true);
141
+ this.smoother.generateNextPositions(this.pdrPosition, true);
135
142
  // this.smoother.pullPosition(position.time) should never return null
136
- this.position = this.smoother.pullPosition(position.time);
143
+ this.position = this.smoother.pullPosition(this.pdrPosition.time);
137
144
  } else {
138
- this.position = position.clone();
145
+ this.position = this.pdrPosition.clone();
139
146
  }
140
147
 
141
148
  this.notify(this.createEvent(EventType.AbsolutePosition, this.position));