@wemap/routers 12.7.8 → 12.8.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.js CHANGED
@@ -3385,11 +3385,25 @@ class IdfmRemoteRouter extends RemoteRouter {
3385
3385
  return urlSearchParams;
3386
3386
  }
3387
3387
  getSectionCoords(section) {
3388
- const from = section.from.stop_point ? jsonToCoordinates$1(section.from.stop_point.coord) : jsonToCoordinates$1(section.from.address.coord);
3389
- const to = section.to.stop_point ? jsonToCoordinates$1(section.to.stop_point.coord) : jsonToCoordinates$1(section.to.address.coord);
3388
+ let from;
3389
+ let to;
3390
+ if ("stop_point" in section.from) {
3391
+ from = section.from.stop_point.coord;
3392
+ } else if ("address" in section.from) {
3393
+ from = section.from.address.coord;
3394
+ } else {
3395
+ from = section.from.poi.coord;
3396
+ }
3397
+ if ("stop_point" in section.to) {
3398
+ to = section.to.stop_point.coord;
3399
+ } else if ("address" in section.to) {
3400
+ to = section.to.address.coord;
3401
+ } else {
3402
+ to = section.to.poi.coord;
3403
+ }
3390
3404
  return {
3391
- from,
3392
- to
3405
+ from: jsonToCoordinates$1(from),
3406
+ to: jsonToCoordinates$1(to)
3393
3407
  };
3394
3408
  }
3395
3409
  /**