@wemap/positioning 2.4.1 → 2.4.2

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.2"
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 (
@@ -192,13 +192,11 @@ class GnssWifiPdrProvider extends MapMatchingProvider {
192
192
  console.warn('Itinerary has not been calculated from GnssWifiPdrProvider and these is not recommanded');
193
193
  }
194
194
 
195
- let startEdge;
196
- if (itinerary.firstEdge.length <= MM_GNSS_DIST) {
197
- startEdge = itinerary.firstEdge;
198
- } else {
199
- startEdge = itinerary.secondEdge;
195
+ const startEdge = itinerary.getEdgeAt(MM_GNSS_DIST);
196
+ if (!startEdge) {
197
+ return;
200
198
  }
201
- const startPoint = WGS84UserPosition.fromWGS84(startEdge.node1);
199
+ const startPoint = WGS84UserPosition.fromWGS84(startEdge.node1.coords);
202
200
  startPoint.alt = Constants.DEFAULT_ALTITUDE;
203
201
  this.pdrProvider.setPosition(startPoint);
204
202
  this.pdrProvider.setStepDetectionLockerOrientation(startEdge.bearing);