@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 +8 -7
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +10 -9
- package/dist/index.mjs.map +1 -1
- package/package.json +4 -4
- package/src/ItineraryInfoManager.ts +2 -2
- package/src/model/Itinerary.ts +2 -2
- package/src/model/Leg.ts +2 -2
- package/src/remote/cityway/CitywayRemoteRouter.ts +2 -1
- package/src/wemap-multi/CustomNetworkMap.ts +7 -7
- package/src/wemap-osm/WemapOsmRouter.spec.ts +9 -9
- package/src/wemap-osm/WemapOsmRouter.ts +10 -10
- package/src/wemap-osm/WemapOsmRouterOptions.ts +5 -5
package/dist/index.js
CHANGED
|
@@ -558,7 +558,7 @@ class RouterResponse {
|
|
|
558
558
|
}
|
|
559
559
|
}
|
|
560
560
|
}
|
|
561
|
-
const _WemapOsmRouterOptions = class extends
|
|
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
|
|
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: (
|
|
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 && ((
|
|
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
|
|
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
|
}
|