@wemap/routers 11.0.0-alpha.4 → 11.0.0-alpha.7

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
@@ -558,7 +558,7 @@ class RouterResponse {
558
558
  }
559
559
  }
560
560
  }
561
- const _WemapOsmRouterOptions = class extends geo.GraphRouterOptions {
561
+ const _WemapOsmRouterOptions = class extends osm.OsmGraphRouterOptions {
562
562
  constructor() {
563
563
  super(...arguments);
564
564
  __publicField(this, "weightEdgeFn", (edge) => edge.builtFrom instanceof osm.OsmNode && edge.builtFrom.isElevator ? 30 : getDurationFromLength(edge.length));
@@ -575,7 +575,7 @@ const _WemapOsmRouterOptions = class extends geo.GraphRouterOptions {
575
575
  let WemapOsmRouterOptions = _WemapOsmRouterOptions;
576
576
  __publicField(WemapOsmRouterOptions, "DEFAULT", new _WemapOsmRouterOptions());
577
577
  const buildStepsRules = (graphItinerary) => (currentCoords, nextCoords) => {
578
- var _a, _b, _c, _d, _e;
578
+ var _a, _b, _c, _d, _e, _f;
579
579
  const edges = graphItinerary.edges;
580
580
  const nodes = graphItinerary.nodes;
581
581
  const node = geo.GraphUtils.getNodeByCoords(nodes, currentCoords);
@@ -589,7 +589,7 @@ const buildStepsRules = (graphItinerary) => (currentCoords, nextCoords) => {
589
589
  const isSubwayEntrance = node ? ((_a = node.builtFrom) == null ? void 0 : _a.tags.railway) === "subway_entrance" : false;
590
590
  const isGate = node ? ((_b = node.builtFrom) == null ? void 0 : _b.tags.barrier) === "gate" || ((_c = node.builtFrom) == null ? void 0 : _c.tags.aeroway) === "gate" : false;
591
591
  let levelChangeType = null;
592
- if (edge.builtFrom instanceof osm.OsmNode && edge.builtFrom.isElevator) {
592
+ if ((_d = edge.builtFrom) == null ? void 0 : _d.isElevator) {
593
593
  levelChangeType = "elevator";
594
594
  } else if (edge.builtFrom instanceof osm.OsmNode || edge.builtFrom instanceof osm.OsmWay && edge.builtFrom.isConveying) {
595
595
  levelChangeType = "conveyor";
@@ -598,17 +598,17 @@ const buildStepsRules = (graphItinerary) => (currentCoords, nextCoords) => {
598
598
  }
599
599
  return {
600
600
  createNewStep: isSubwayEntrance,
601
- stepName: (_d = edge.builtFrom) == null ? void 0 : _d.tags.name,
601
+ stepName: (_e = edge.builtFrom) == null ? void 0 : _e.tags.name,
602
602
  duration: graphItinerary.edgesWeights[edgeId],
603
603
  stepExtras: {
604
604
  ...isSubwayEntrance && { isSubwayEntrance: true },
605
- ...isSubwayEntrance && ((_e = node.builtFrom) == null ? void 0 : _e.tags.ref) && { subwayEntranceRef: node.builtFrom.tags.ref },
605
+ ...isSubwayEntrance && ((_f = node.builtFrom) == null ? void 0 : _f.tags.ref) && { subwayEntranceRef: node.builtFrom.tags.ref },
606
606
  ...isGate && { isGate: true }
607
607
  },
608
608
  ...levelChangeType && { levelChangeType }
609
609
  };
610
610
  };
611
- class WemapOsmRouter extends geo.GraphRouter {
611
+ class WemapOsmRouter extends osm.OsmGraphRouter {
612
612
  constructor(network) {
613
613
  super(network);
614
614
  }
@@ -850,7 +850,8 @@ class CitywayRemoteRouter extends RemoteRouter {
850
850
  coords: legCoords,
851
851
  from: legFrom,
852
852
  to: legTo,
853
- transportInfo
853
+ transportInfo,
854
+ stepsInfo
854
855
  });
855
856
  legs.push(leg);
856
857
  }