@wemap/routers 12.7.6 → 12.7.8
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 +5 -6
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +5 -6
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
- package/src/graph/GraphRouter.ts +0 -1
- package/src/graph/GraphRouterOptions.ts +1 -1
- package/src/graph/GraphRouterOptionsBuilder.ts +5 -5
- package/src/model/RouterRequest.ts +2 -2
- package/src/wemap-osm/OsmRouter.spec.ts +1 -1
package/package.json
CHANGED
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
"directory": "packages/routers"
|
|
13
13
|
},
|
|
14
14
|
"name": "@wemap/routers",
|
|
15
|
-
"version": "12.7.
|
|
15
|
+
"version": "12.7.8",
|
|
16
16
|
"bugs": {
|
|
17
17
|
"url": "https://github.com/wemap/wemap-modules-js/issues"
|
|
18
18
|
},
|
|
@@ -52,5 +52,5 @@
|
|
|
52
52
|
},
|
|
53
53
|
"./helpers/*": "./helpers/*"
|
|
54
54
|
},
|
|
55
|
-
"gitHead": "
|
|
55
|
+
"gitHead": "d2c612388561bda3575645067f25ddfc8b239495"
|
|
56
56
|
}
|
package/src/graph/GraphRouter.ts
CHANGED
|
@@ -113,7 +113,6 @@ class GraphRouter extends GraphRouterEngine {
|
|
|
113
113
|
newVertex.id = this.graph.vertices.length + createdVertices.size;
|
|
114
114
|
const newEdgesOptions: EdgeProperties = {
|
|
115
115
|
...edge.properties,
|
|
116
|
-
name: `splitted ${edge.properties.name || null} (tmp)`,
|
|
117
116
|
...(typeof edge.properties.externalId !== 'undefined' && { externalId: edge.properties.externalId })
|
|
118
117
|
};
|
|
119
118
|
const newEdge1 = new Edge(edge.vertex1, newVertex, newEdgesOptions);
|
|
@@ -11,7 +11,7 @@ export type GraphRouterOptionsJson = {
|
|
|
11
11
|
avoidStairs?: boolean;
|
|
12
12
|
avoidEscalators?: boolean;
|
|
13
13
|
avoidElevators?: boolean;
|
|
14
|
-
|
|
14
|
+
avoidMovingWalkways?: boolean;
|
|
15
15
|
avoidTicketRestrictedAreas?: boolean;
|
|
16
16
|
projectionMaxDistance?: number; // in meters
|
|
17
17
|
}
|
|
@@ -7,7 +7,7 @@ export default class GraphRouterOptionsBuilder {
|
|
|
7
7
|
public avoidStairs = false;
|
|
8
8
|
public avoidEscalators = false;
|
|
9
9
|
public avoidElevators = false;
|
|
10
|
-
public
|
|
10
|
+
public avoidMovingWalkways = false;
|
|
11
11
|
public avoidTicketRestrictedAreas = false;
|
|
12
12
|
|
|
13
13
|
public projectionMaxDistance?: number;
|
|
@@ -30,8 +30,8 @@ export default class GraphRouterOptionsBuilder {
|
|
|
30
30
|
return this;
|
|
31
31
|
}
|
|
32
32
|
|
|
33
|
-
|
|
34
|
-
this.
|
|
33
|
+
setAvoidMovingWalkways(avoidMovingWalkways: boolean) {
|
|
34
|
+
this.avoidMovingWalkways = avoidMovingWalkways;
|
|
35
35
|
return this;
|
|
36
36
|
}
|
|
37
37
|
|
|
@@ -68,7 +68,7 @@ export default class GraphRouterOptionsBuilder {
|
|
|
68
68
|
if (this.avoidStairs && edge.properties.areStairs) return false;
|
|
69
69
|
if (this.avoidEscalators && edge.properties.areEscalators) return false;
|
|
70
70
|
if (this.avoidElevators && edge.properties.isElevator) return false;
|
|
71
|
-
if (this.
|
|
71
|
+
if (this.avoidMovingWalkways && edge.properties.isMovingWalkway) return false;
|
|
72
72
|
if (this.avoidTicketRestrictedAreas && edge.properties.needTicket) return false;
|
|
73
73
|
|
|
74
74
|
return true;
|
|
@@ -79,7 +79,7 @@ export default class GraphRouterOptionsBuilder {
|
|
|
79
79
|
avoidStairs: this.avoidStairs,
|
|
80
80
|
avoidEscalators: this.avoidEscalators,
|
|
81
81
|
avoidElevators: this.avoidElevators,
|
|
82
|
-
|
|
82
|
+
avoidMovingWalkways: this.avoidMovingWalkways,
|
|
83
83
|
avoidTicketRestrictedAreas: this.avoidTicketRestrictedAreas,
|
|
84
84
|
projectionMaxDistance: this.projectionMaxDistance
|
|
85
85
|
},
|
|
@@ -13,8 +13,8 @@ export type RouterRequest = {
|
|
|
13
13
|
itineraryModifiers?: {
|
|
14
14
|
avoidStairs?: boolean,
|
|
15
15
|
avoidEscalators?: boolean,
|
|
16
|
-
|
|
17
|
-
|
|
16
|
+
avoidElevators?: boolean,
|
|
17
|
+
avoidMovingWalkways?: boolean,
|
|
18
18
|
avoidTicketRestrictedAreas?: boolean
|
|
19
19
|
}
|
|
20
20
|
output?: {
|
|
@@ -69,7 +69,7 @@ describe('OsmRouter - Multi-level itinerary', () => {
|
|
|
69
69
|
expect(steps.length).equal(8);
|
|
70
70
|
|
|
71
71
|
expect(steps[0].coords.equals(itineraryStart.getSegmentProjection(p[6].coords, p[7].coords) as Coordinates)).true;
|
|
72
|
-
expect(steps[0].name).equals('
|
|
72
|
+
expect(steps[0].name).equals('w2');
|
|
73
73
|
expect(steps[0].number).equals(1);
|
|
74
74
|
expect(steps[0].angle).almost.equals(-1.57);
|
|
75
75
|
expect(steps[0].previousBearing).almost.equals(1.778);
|