@wemap/positioning 2.4.1 → 2.4.3

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
@@ -80,5 +80,5 @@
80
80
  "lint": "eslint --ext .js,.jsx --quiet src",
81
81
  "test": "mocha -r esm \"src/**/*.spec.js\""
82
82
  },
83
- "version": "2.4.1"
83
+ "version": "2.4.3"
84
84
  }
@@ -84,7 +84,9 @@ class PositioningPoseComponent extends React.Component {
84
84
  const positionRender = Utils.renderPosition(this.state.position);
85
85
 
86
86
  const itineraryRender = Utils.renderItineraryInfo(
87
- this.state.position ? Utils.ITINERARY.getInfo(this.state.position) : null
87
+ this.state.position && !(this.state.position instanceof Error)
88
+ ? Utils.ITINERARY.getInfo(this.state.position)
89
+ : null
88
90
  );
89
91
 
90
92
  return (
@@ -34,6 +34,10 @@ class GnssWifiPdrProvider extends MapMatchingProvider {
34
34
  this.gpsLastUpdate = 0;
35
35
  this.isFirstGnssUpdate = true;
36
36
  this.isFirstAttitudeUpdate = true;
37
+
38
+ if (this.options.useMapMatching) {
39
+ this.enableMapMatching();
40
+ }
37
41
  }
38
42
 
39
43
 
@@ -192,13 +196,11 @@ class GnssWifiPdrProvider extends MapMatchingProvider {
192
196
  console.warn('Itinerary has not been calculated from GnssWifiPdrProvider and these is not recommanded');
193
197
  }
194
198
 
195
- let startEdge;
196
- if (itinerary.firstEdge.length <= MM_GNSS_DIST) {
197
- startEdge = itinerary.firstEdge;
198
- } else {
199
- startEdge = itinerary.secondEdge;
199
+ const startEdge = itinerary.getEdgeAt(MM_GNSS_DIST);
200
+ if (!startEdge) {
201
+ return;
200
202
  }
201
- const startPoint = WGS84UserPosition.fromWGS84(startEdge.node1);
203
+ const startPoint = WGS84UserPosition.fromWGS84(startEdge.node1.coords);
202
204
  startPoint.alt = Constants.DEFAULT_ALTITUDE;
203
205
  this.pdrProvider.setPosition(startPoint);
204
206
  this.pdrProvider.setStepDetectionLockerOrientation(startEdge.bearing);
@@ -91,6 +91,7 @@ class GnssWifiProvider extends Provider {
91
91
  coords.latitude,
92
92
  coords.longitude,
93
93
  coords.altitude,
94
+ null,
94
95
  timestamp,
95
96
  coords.accuracy,
96
97
  bearing,
@@ -44,6 +44,7 @@ class IpProvider extends Provider {
44
44
  parseFloat(response.loc.split(',')[0]),
45
45
  parseFloat(response.loc.split(',')[1]),
46
46
  null,
47
+ null,
47
48
  timestamp
48
49
  );
49
50