@wemap/routers 12.7.8 → 12.8.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/dist/index.mjs CHANGED
@@ -3331,6 +3331,7 @@ class IdfmRemoteRouter extends RemoteRouter {
3331
3331
  const coreParams = new URLSearchParams();
3332
3332
  coreParams.set("from", `${origin.longitude};${origin.latitude}`);
3333
3333
  coreParams.set("to", `${destination.longitude};${destination.latitude}`);
3334
+ coreParams.set("data_freshness", "realtime");
3334
3335
  if ((_a = routerRequest.itineraryModifiers) == null ? void 0 : _a.avoidStairs) {
3335
3336
  coreParams.set("wheelchair", "true");
3336
3337
  }
@@ -3383,11 +3384,25 @@ class IdfmRemoteRouter extends RemoteRouter {
3383
3384
  return urlSearchParams;
3384
3385
  }
3385
3386
  getSectionCoords(section) {
3386
- const from = section.from.stop_point ? jsonToCoordinates$1(section.from.stop_point.coord) : jsonToCoordinates$1(section.from.address.coord);
3387
- const to = section.to.stop_point ? jsonToCoordinates$1(section.to.stop_point.coord) : jsonToCoordinates$1(section.to.address.coord);
3387
+ let from;
3388
+ let to;
3389
+ if ("stop_point" in section.from) {
3390
+ from = section.from.stop_point.coord;
3391
+ } else if ("address" in section.from) {
3392
+ from = section.from.address.coord;
3393
+ } else {
3394
+ from = section.from.poi.coord;
3395
+ }
3396
+ if ("stop_point" in section.to) {
3397
+ to = section.to.stop_point.coord;
3398
+ } else if ("address" in section.to) {
3399
+ to = section.to.address.coord;
3400
+ } else {
3401
+ to = section.to.poi.coord;
3402
+ }
3388
3403
  return {
3389
- from,
3390
- to
3404
+ from: jsonToCoordinates$1(from),
3405
+ to: jsonToCoordinates$1(to)
3391
3406
  };
3392
3407
  }
3393
3408
  /**