@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
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
<?xml version='1.0' encoding='UTF-8'?>
|
|
2
|
+
<osm version='0.6' generator='JOSM'>
|
|
3
|
+
<node id='-161218670344274' action='modify' visible='true' lat='48.84835435445' lon='2.39650479554' />
|
|
4
|
+
<node id='-161218670344470' action='modify' visible='true' lat='48.84826992031' lon='2.39687830076' />
|
|
5
|
+
<way id='-921430905723165' action='modify' visible='true'>
|
|
6
|
+
<nd ref='-161218670344470' />
|
|
7
|
+
<nd ref='-161218670344274' />
|
|
8
|
+
<tag k='highway' v='elevator' />
|
|
9
|
+
<tag k='incline' v='up' />
|
|
10
|
+
<tag k='level' v='-3' />
|
|
11
|
+
</way>
|
|
12
|
+
</osm>
|
package/dist/index.js
CHANGED
|
@@ -439,6 +439,8 @@ class StepsBuilder {
|
|
|
439
439
|
levelChangeType = "stairs";
|
|
440
440
|
} else if (isMovingWalkway) {
|
|
441
441
|
levelChangeType = "moving walkway";
|
|
442
|
+
} else {
|
|
443
|
+
levelChangeType = "incline plane";
|
|
442
444
|
}
|
|
443
445
|
let forceLevelChange;
|
|
444
446
|
if ((areStairs || isElevator) && incline && !(previousStep == null ? void 0 : previousStep.levelChange)) {
|
|
@@ -2833,7 +2835,7 @@ const _OsmGraphUtils = class _OsmGraphUtils {
|
|
|
2833
2835
|
}
|
|
2834
2836
|
});
|
|
2835
2837
|
let fakeOsmNodeId = -1;
|
|
2836
|
-
osmModel.ways.filter((way) => way.isElevator).forEach((way) => {
|
|
2838
|
+
osmModel.ways.filter((way) => way.isElevator && way.isGeometryClosed).forEach((way) => {
|
|
2837
2839
|
const entryVertices = way.nodes.map((node) => verticesMapping.filter(([osmId]) => osmId === node.id).map((vm) => vm[1])).flat();
|
|
2838
2840
|
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);
|
|
2839
2841
|
const elevatorLevel = entryVertices.reduce((acc, v) => geo.Level.union(acc, v.coords.level), null);
|
|
@@ -4997,6 +4999,9 @@ const _InstructionManager = class _InstructionManager {
|
|
|
4997
4999
|
if (step.levelChange.type === "moving walkway") {
|
|
4998
5000
|
return "Go up the moving walkway";
|
|
4999
5001
|
}
|
|
5002
|
+
if (step.levelChange.type === "incline plane") {
|
|
5003
|
+
return "Go up the incline plane";
|
|
5004
|
+
}
|
|
5000
5005
|
return "Go up" + suffix;
|
|
5001
5006
|
}
|
|
5002
5007
|
if (step.levelChange.direction === "down") {
|
|
@@ -5012,6 +5017,9 @@ const _InstructionManager = class _InstructionManager {
|
|
|
5012
5017
|
if (step.levelChange.type === "moving walkway") {
|
|
5013
5018
|
return "Go down the moving walkway";
|
|
5014
5019
|
}
|
|
5020
|
+
if (step.levelChange.type === "incline plane") {
|
|
5021
|
+
return "Go down the incline plane";
|
|
5022
|
+
}
|
|
5015
5023
|
return "Go down" + suffix;
|
|
5016
5024
|
}
|
|
5017
5025
|
if ((_b = step.extras) == null ? void 0 : _b.subwayEntrance) {
|