@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
|
@@ -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
|
-
|
|
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(
|
|
141
|
+
this.smoother.generateNextPositions(this.pdrPosition, true);
|
|
135
142
|
// this.smoother.pullPosition(position.time) should never return null
|
|
136
|
-
this.position = this.smoother.pullPosition(
|
|
143
|
+
this.position = this.smoother.pullPosition(this.pdrPosition.time);
|
|
137
144
|
} else {
|
|
138
|
-
this.position =
|
|
145
|
+
this.position = this.pdrPosition.clone();
|
|
139
146
|
}
|
|
140
147
|
|
|
141
148
|
this.notify(this.createEvent(EventType.AbsolutePosition, this.position));
|