@wemap/osm 4.0.12 → 4.0.14
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/package.json
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"directory": "packages/osm"
|
|
12
12
|
},
|
|
13
13
|
"name": "@wemap/osm",
|
|
14
|
-
"version": "4.0.
|
|
14
|
+
"version": "4.0.14",
|
|
15
15
|
"bugs": {
|
|
16
16
|
"url": "https://github.com/wemap/wemap-modules-js/issues"
|
|
17
17
|
},
|
|
@@ -25,10 +25,10 @@
|
|
|
25
25
|
],
|
|
26
26
|
"license": "ISC",
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"@wemap/geo": "^4.0.
|
|
28
|
+
"@wemap/geo": "^4.0.14",
|
|
29
29
|
"@wemap/logger": "^4.0.0",
|
|
30
30
|
"@wemap/maths": "^4.0.3",
|
|
31
31
|
"sax": "^1.2.4"
|
|
32
32
|
},
|
|
33
|
-
"gitHead": "
|
|
33
|
+
"gitHead": "0b7188383438fcb1dd498dd117799076115dfee6"
|
|
34
34
|
}
|
|
@@ -76,6 +76,9 @@ class OsmNetworkUtils {
|
|
|
76
76
|
static _applyNodePropertiesFromTags(node, tags) {
|
|
77
77
|
node.name = tags.name || null;
|
|
78
78
|
node.subwayEntrance = tags.railway === 'subway_entrance';
|
|
79
|
+
if (node.subwayEntrance && tags.ref) {
|
|
80
|
+
node.subwayEntranceRef = tags.ref;
|
|
81
|
+
}
|
|
79
82
|
}
|
|
80
83
|
|
|
81
84
|
/**
|
package/src/osrm/OsrmUtils.js
CHANGED
|
@@ -78,7 +78,7 @@ export function itineraryToOsrmJson(itinerary) {
|
|
|
78
78
|
|
|
79
79
|
const {
|
|
80
80
|
nodes, length, nextEdge, nextBearing, previousBearing, angle, node,
|
|
81
|
-
duration, levelChange
|
|
81
|
+
duration, levelChange, subwayEntrance, subwayEntranceRef
|
|
82
82
|
} = itinerarySteps[i];
|
|
83
83
|
|
|
84
84
|
const name = (i === lastStepId ? node.name : nextEdge.name) || '';
|
|
@@ -108,9 +108,12 @@ export function itineraryToOsrmJson(itinerary) {
|
|
|
108
108
|
if (levelChange !== null) {
|
|
109
109
|
osrmStep.levelChange = levelChange;
|
|
110
110
|
}
|
|
111
|
-
if (
|
|
111
|
+
if (subwayEntrance) {
|
|
112
112
|
osrmStep.name = node.name;
|
|
113
113
|
osrmStep.subwayEntrance = true;
|
|
114
|
+
if (subwayEntranceRef) {
|
|
115
|
+
osrmStep.subwayEntranceRef = subwayEntranceRef;
|
|
116
|
+
}
|
|
114
117
|
}
|
|
115
118
|
|
|
116
119
|
// The first modifier is not mandatory by OSRM.
|
|
@@ -146,6 +149,10 @@ export function itineraryToOsrmJson(itinerary) {
|
|
|
146
149
|
};
|
|
147
150
|
}
|
|
148
151
|
|
|
152
|
+
/**
|
|
153
|
+
* @param {Itinerary} itinerary
|
|
154
|
+
* @param {object} jsonSteps
|
|
155
|
+
*/
|
|
149
156
|
function _parseSteps(itinerary, jsonSteps) {
|
|
150
157
|
|
|
151
158
|
itinerary._steps = [];
|
|
@@ -202,6 +209,17 @@ function _parseSteps(itinerary, jsonSteps) {
|
|
|
202
209
|
currentNodeIndex++;
|
|
203
210
|
}
|
|
204
211
|
|
|
212
|
+
|
|
213
|
+
const firstStepNode = step.nodes[0];
|
|
214
|
+
if (jsonStep.subwayEntrance === true) {
|
|
215
|
+
firstStepNode.subwayEntrance = true;
|
|
216
|
+
step.subwayEntrance = true;
|
|
217
|
+
if (jsonStep.subwayEntranceRef) {
|
|
218
|
+
firstStepNode.subwayEntranceRef = jsonStep.subwayEntranceRef;
|
|
219
|
+
step.subwayEntranceRef = jsonStep.subwayEntranceRef;
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
|
|
205
223
|
/**
|
|
206
224
|
* Add common fields
|
|
207
225
|
*/
|