@wemap/osm 5.0.5 → 5.0.6

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": "5.0.5",
14
+ "version": "5.0.6",
15
15
  "bugs": {
16
16
  "url": "https://github.com/wemap/wemap-modules-js/issues"
17
17
  },
@@ -31,5 +31,5 @@
31
31
  "@wemap/maths": "^5.0.0",
32
32
  "sax": "^1.2.4"
33
33
  },
34
- "gitHead": "8810cc32fb87c196e8350e0a0e6f6f7671fe4246"
34
+ "gitHead": "412142e60e70b1e18989c616c6c7d3b6f577ef2c"
35
35
  }
@@ -101,6 +101,8 @@ export function createRouterResponseFromJson(json) {
101
101
  };
102
102
  leg.coords = Polyline.decode(jsonLeg.legGeometry.points).map(([lat, lon]) => new Coordinates(lat, lon));
103
103
 
104
+ leg.steps = parseJsonSteps(jsonLeg.steps, leg.coords);
105
+
104
106
  if (leg.mode === 'BUS' || leg.mode === 'TRAM') {
105
107
  leg.transportInfo = {
106
108
  name: jsonLeg.route,
@@ -108,6 +110,14 @@ export function createRouterResponseFromJson(json) {
108
110
  routeTextColor: jsonLeg.routeTextColor,
109
111
  directionName: jsonLeg.headsign
110
112
  };
113
+
114
+ const legStep = new Step();
115
+ legStep.coords = leg.coords[0];
116
+ legStep._idCoordsInLeg = 0;
117
+ legStep.name = jsonLeg.headsign;
118
+ legStep.levelChange = null;
119
+ legStep.distance = jsonLeg.distance;
120
+ leg.steps = [legStep];
111
121
  }
112
122
 
113
123
  // jsonLeg.distance is not reliable when compared to the array of leg coords.
@@ -119,8 +129,6 @@ export function createRouterResponseFromJson(json) {
119
129
  return acc + arr[idx - 1].distanceTo(coords);
120
130
  }, 0);
121
131
 
122
- leg.steps = parseJsonSteps(jsonLeg.steps, leg.coords);
123
-
124
132
  itinerary.legs.push(leg);
125
133
 
126
134
  }