@wemap/routers 12.10.1 → 12.10.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
@@ -12,7 +12,7 @@
12
12
  "directory": "packages/routers"
13
13
  },
14
14
  "name": "@wemap/routers",
15
- "version": "12.10.1",
15
+ "version": "12.10.2",
16
16
  "bugs": {
17
17
  "url": "https://github.com/wemap/wemap-modules-js/issues"
18
18
  },
@@ -53,5 +53,5 @@
53
53
  },
54
54
  "./helpers/*": "./helpers/*"
55
55
  },
56
- "gitHead": "5c2e798da24231b5643f1e1ed306b729e1e87354"
56
+ "gitHead": "bbb66cb6fd46372de7cd8b474d60c7ef3ab6f0d4"
57
57
  }
@@ -54,11 +54,7 @@ class ItineraryInfoManager {
54
54
  this._coordsPreviousStep = new Array(itinerary.coords.length);
55
55
  this._coordsDistanceTraveled = new Array(itinerary.coords.length);
56
56
  this._coordsLeg = new Array(itinerary.coords.length);
57
- const originProjectionDistance = this._itinerary.origin.distanceTo(this._itinerary.coords[0]);
58
- const destinationProjectionDistance = this._itinerary.destination.distanceTo(this._itinerary.coords[this._itinerary.coords.length - 1]);
59
- this._itineraryDistanceWithoutProjections = itinerary.distance
60
- - originProjectionDistance
61
- - destinationProjectionDistance;
57
+ this._itineraryDistanceWithoutProjections = itinerary.distance;
62
58
 
63
59
  let stepId = 0;
64
60
  let previousStep: Step | null = null;
@@ -139,7 +139,7 @@ export default class Itinerary {
139
139
 
140
140
  get distance() {
141
141
  if (this._distance === null) {
142
- this._distance = GeoUtils.calcDistance([this.origin, ...this.coords, this.destination]);
142
+ this._distance = GeoUtils.calcDistance(this.coords);
143
143
  }
144
144
  return this._distance;
145
145
 
@@ -31,7 +31,7 @@ describe('CitywayRemoteRouter - parseResponse', () => {
31
31
  const itinerary1 = itineraries[0];
32
32
  expect(itinerary1.origin.equals(new Coordinates(49.515093882362159, 0.093417496193663158))).true;
33
33
  expect(itinerary1.destination.equals(new Coordinates(49.5067090188444, 0.16948421154178309))).true;
34
- expect(itinerary1.distance).to.be.closeTo(6919, 1);
34
+ expect(itinerary1.distance).to.be.closeTo(6887, 1);
35
35
  expect(itinerary1.duration).equal(2379);
36
36
  expect(itinerary1.transitMode).equal('BUS');
37
37
  // Do not work because of the input time format
@@ -31,7 +31,7 @@ describe('GeoveloRouter - parseResponse', () => {
31
31
  const itinerary1 = itineraries[0];
32
32
  expect(itinerary1.origin.equals(new Coordinates(43.596949, 3.877772))).true;
33
33
  expect(itinerary1.destination.equals(new Coordinates(43.609609, 3.914684))).true;
34
- expect(itinerary1.distance).to.be.closeTo(4031, 1);
34
+ expect(itinerary1.distance).to.be.closeTo(4029, 1);
35
35
  expect(itinerary1.duration).equal(1053);
36
36
  expect(itinerary1.transitMode).equal('BIKE');
37
37
  // Do not work because of the input time format
@@ -37,7 +37,7 @@ describe('OsrmRemoteRouter - parseResponse', () => {
37
37
  const itinerary1 = itineraries[0];
38
38
  expect(itinerary1.origin.equals(origin)).true;
39
39
  expect(itinerary1.destination.equals(destination)).true;
40
- expect(itinerary1.distance).closeTo(429, 1);
40
+ expect(itinerary1.distance).closeTo(400, 1);
41
41
  expect(itinerary1.duration).equal(287.8);
42
42
  expect(itinerary1.startTime).is.null;
43
43
  expect(itinerary1.endTime).is.null;