@wemap/osm 4.0.13 → 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.13",
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.13",
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": "938eca06514ecc7ee1f4388866bbf7f174d51a9b"
33
+ "gitHead": "0b7188383438fcb1dd498dd117799076115dfee6"
34
34
  }
@@ -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,11 +108,11 @@ export function itineraryToOsrmJson(itinerary) {
108
108
  if (levelChange !== null) {
109
109
  osrmStep.levelChange = levelChange;
110
110
  }
111
- if (node.subwayEntrance) {
111
+ if (subwayEntrance) {
112
112
  osrmStep.name = node.name;
113
113
  osrmStep.subwayEntrance = true;
114
- if (node.subwayEntranceRef) {
115
- osrmStep.subwayEntranceRef = node.subwayEntranceRef;
114
+ if (subwayEntranceRef) {
115
+ osrmStep.subwayEntranceRef = subwayEntranceRef;
116
116
  }
117
117
  }
118
118
 
@@ -149,6 +149,10 @@ export function itineraryToOsrmJson(itinerary) {
149
149
  };
150
150
  }
151
151
 
152
+ /**
153
+ * @param {Itinerary} itinerary
154
+ * @param {object} jsonSteps
155
+ */
152
156
  function _parseSteps(itinerary, jsonSteps) {
153
157
 
154
158
  itinerary._steps = [];
@@ -205,6 +209,17 @@ function _parseSteps(itinerary, jsonSteps) {
205
209
  currentNodeIndex++;
206
210
  }
207
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
+
208
223
  /**
209
224
  * Add common fields
210
225
  */