@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/dist/index.mjs CHANGED
@@ -764,7 +764,7 @@ class Itinerary {
764
764
  }
765
765
  get distance() {
766
766
  if (this._distance === null) {
767
- this._distance = Utils.calcDistance([this.origin, ...this.coords, this.destination]);
767
+ this._distance = Utils.calcDistance(this.coords);
768
768
  }
769
769
  return this._distance;
770
770
  }
@@ -4840,9 +4840,7 @@ class ItineraryInfoManager {
4840
4840
  this._coordsPreviousStep = new Array(itinerary.coords.length);
4841
4841
  this._coordsDistanceTraveled = new Array(itinerary.coords.length);
4842
4842
  this._coordsLeg = new Array(itinerary.coords.length);
4843
- const originProjectionDistance = this._itinerary.origin.distanceTo(this._itinerary.coords[0]);
4844
- const destinationProjectionDistance = this._itinerary.destination.distanceTo(this._itinerary.coords[this._itinerary.coords.length - 1]);
4845
- this._itineraryDistanceWithoutProjections = itinerary.distance - originProjectionDistance - destinationProjectionDistance;
4843
+ this._itineraryDistanceWithoutProjections = itinerary.distance;
4846
4844
  let stepId = 0;
4847
4845
  let previousStep = null;
4848
4846
  let nextStep = this._steps[0];