@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
|
@@ -86,6 +86,9 @@ export default class InstructionManager {
|
|
|
86
86
|
if (step.levelChange.type === 'moving walkway') {
|
|
87
87
|
return 'Go up the moving walkway';
|
|
88
88
|
}
|
|
89
|
+
if (step.levelChange.type === 'incline plane') {
|
|
90
|
+
return 'Go up the incline plane';
|
|
91
|
+
}
|
|
89
92
|
return 'Go up' + suffix;
|
|
90
93
|
}
|
|
91
94
|
if (step.levelChange.direction === 'down') {
|
|
@@ -101,6 +104,9 @@ export default class InstructionManager {
|
|
|
101
104
|
if (step.levelChange.type === 'moving walkway') {
|
|
102
105
|
return 'Go down the moving walkway';
|
|
103
106
|
}
|
|
107
|
+
if (step.levelChange.type === 'incline plane') {
|
|
108
|
+
return 'Go down the incline plane';
|
|
109
|
+
}
|
|
104
110
|
return 'Go down' + suffix;
|
|
105
111
|
}
|
|
106
112
|
if (step.extras?.subwayEntrance) {
|
package/package.json
CHANGED
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
"directory": "packages/routers"
|
|
13
13
|
},
|
|
14
14
|
"name": "@wemap/routers",
|
|
15
|
-
"version": "12.
|
|
15
|
+
"version": "12.10.0",
|
|
16
16
|
"bugs": {
|
|
17
17
|
"url": "https://github.com/wemap/wemap-modules-js/issues"
|
|
18
18
|
},
|
|
@@ -34,10 +34,10 @@
|
|
|
34
34
|
"@turf/convex": "^6.5.0",
|
|
35
35
|
"@turf/helpers": "^6.5.0",
|
|
36
36
|
"@types/mapbox__polyline": "^1.0.2",
|
|
37
|
-
"@wemap/geo": "^12.
|
|
38
|
-
"@wemap/logger": "^12.
|
|
39
|
-
"@wemap/maths": "^12.
|
|
40
|
-
"@wemap/osm": "^12.
|
|
37
|
+
"@wemap/geo": "^12.10.0",
|
|
38
|
+
"@wemap/logger": "^12.10.0",
|
|
39
|
+
"@wemap/maths": "^12.10.0",
|
|
40
|
+
"@wemap/osm": "^12.10.0",
|
|
41
41
|
"@wemap/salesman.js": "^2.1.0"
|
|
42
42
|
},
|
|
43
43
|
"devDependencies": {
|
|
@@ -47,10 +47,11 @@
|
|
|
47
47
|
},
|
|
48
48
|
"exports": {
|
|
49
49
|
".": {
|
|
50
|
+
"types": "./index.ts",
|
|
50
51
|
"import": "./dist/index.mjs",
|
|
51
52
|
"require": "./dist/index.js"
|
|
52
53
|
},
|
|
53
54
|
"./helpers/*": "./helpers/*"
|
|
54
55
|
},
|
|
55
|
-
"gitHead": "
|
|
56
|
+
"gitHead": "e5293ab739c4cf3121f56e4fdb31510ab431dc45"
|
|
56
57
|
}
|
package/src/model/LevelChange.ts
CHANGED
|
@@ -80,9 +80,11 @@ export default class StepsBuilder {
|
|
|
80
80
|
levelChangeType = 'stairs';
|
|
81
81
|
} else if (isMovingWalkway) {
|
|
82
82
|
levelChangeType = 'moving walkway';
|
|
83
|
+
} else {
|
|
84
|
+
levelChangeType = 'incline plane';
|
|
83
85
|
}
|
|
84
86
|
|
|
85
|
-
// Handle stairs/elevators/escalators/moving walkway without change in level coordinates
|
|
87
|
+
// Handle stairs/elevators/escalators/moving walkway/incline plane without change in level coordinates
|
|
86
88
|
let forceLevelChange: 'up' | 'down' | undefined;
|
|
87
89
|
if (
|
|
88
90
|
(areStairs || isElevator)
|
|
@@ -150,4 +150,16 @@ describe('OsmGraph - complex', () => {
|
|
|
150
150
|
|
|
151
151
|
});
|
|
152
152
|
|
|
153
|
+
it('horizontal elevator', () => {
|
|
154
|
+
|
|
155
|
+
const osmXmlString = loadFile('horizontal-elevator.osm');
|
|
156
|
+
const osmModel = OsmParser.parseOsmXmlString(osmXmlString);
|
|
157
|
+
const graph = OsmGraphUtils.createGraphFromOsmModel(osmModel);
|
|
158
|
+
|
|
159
|
+
verifyCoherence(graph);
|
|
160
|
+
|
|
161
|
+
expect(graph.vertices.length).equals(2);
|
|
162
|
+
expect(graph.edges.length).equals(1);
|
|
163
|
+
});
|
|
164
|
+
|
|
153
165
|
});
|
|
@@ -134,7 +134,7 @@ export default class OsmGraphUtils {
|
|
|
134
134
|
// It creates a graph from entries to the center of the elevator shape.
|
|
135
135
|
let fakeOsmNodeId = -1;
|
|
136
136
|
osmModel.ways
|
|
137
|
-
.filter(way => way.isElevator)
|
|
137
|
+
.filter(way => way.isElevator && way.isGeometryClosed)
|
|
138
138
|
.forEach(way => {
|
|
139
139
|
const entryVertices = way.nodes.map(node => verticesMapping.filter(([osmId]) => osmId === node.id).map(vm => vm[1])).flat();
|
|
140
140
|
|