@wemap/routers 12.9.0 → 12.10.0
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/assets/horizontal-elevator.osm +12 -0
- package/dist/index.js +9 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +9 -1
- package/dist/index.mjs.map +1 -1
- package/helpers/InstructionManager.ts +6 -0
- package/package.json +7 -6
- package/src/model/LevelChange.ts +1 -1
- package/src/model/StepsBuilder.ts +3 -1
- package/src/wemap-osm/OsmGraphUtils.spec.ts +12 -0
- package/src/wemap-osm/OsmGraphUtils.ts +1 -1
package/dist/index.mjs
CHANGED
|
@@ -437,6 +437,8 @@ class StepsBuilder {
|
|
|
437
437
|
levelChangeType = "stairs";
|
|
438
438
|
} else if (isMovingWalkway) {
|
|
439
439
|
levelChangeType = "moving walkway";
|
|
440
|
+
} else {
|
|
441
|
+
levelChangeType = "incline plane";
|
|
440
442
|
}
|
|
441
443
|
let forceLevelChange;
|
|
442
444
|
if ((areStairs || isElevator) && incline && !(previousStep == null ? void 0 : previousStep.levelChange)) {
|
|
@@ -2831,7 +2833,7 @@ const _OsmGraphUtils = class _OsmGraphUtils {
|
|
|
2831
2833
|
}
|
|
2832
2834
|
});
|
|
2833
2835
|
let fakeOsmNodeId = -1;
|
|
2834
|
-
osmModel.ways.filter((way) => way.isElevator).forEach((way) => {
|
|
2836
|
+
osmModel.ways.filter((way) => way.isElevator && way.isGeometryClosed).forEach((way) => {
|
|
2835
2837
|
const entryVertices = way.nodes.map((node) => verticesMapping.filter(([osmId]) => osmId === node.id).map((vm) => vm[1])).flat();
|
|
2836
2838
|
const elevatorCenter = way.nodes.reduce((acc, node) => [acc[0] + node.coords.lat, acc[1] + node.coords.lng], [0, 0]).map((val) => val / way.nodes.length);
|
|
2837
2839
|
const elevatorLevel = entryVertices.reduce((acc, v) => Level.union(acc, v.coords.level), null);
|
|
@@ -4995,6 +4997,9 @@ const _InstructionManager = class _InstructionManager {
|
|
|
4995
4997
|
if (step.levelChange.type === "moving walkway") {
|
|
4996
4998
|
return "Go up the moving walkway";
|
|
4997
4999
|
}
|
|
5000
|
+
if (step.levelChange.type === "incline plane") {
|
|
5001
|
+
return "Go up the incline plane";
|
|
5002
|
+
}
|
|
4998
5003
|
return "Go up" + suffix;
|
|
4999
5004
|
}
|
|
5000
5005
|
if (step.levelChange.direction === "down") {
|
|
@@ -5010,6 +5015,9 @@ const _InstructionManager = class _InstructionManager {
|
|
|
5010
5015
|
if (step.levelChange.type === "moving walkway") {
|
|
5011
5016
|
return "Go down the moving walkway";
|
|
5012
5017
|
}
|
|
5018
|
+
if (step.levelChange.type === "incline plane") {
|
|
5019
|
+
return "Go down the incline plane";
|
|
5020
|
+
}
|
|
5013
5021
|
return "Go down" + suffix;
|
|
5014
5022
|
}
|
|
5015
5023
|
if ((_b = step.extras) == null ? void 0 : _b.subwayEntrance) {
|