@wemap/osm 1.0.1 → 1.0.2
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": "1.0.
|
|
14
|
+
"version": "1.0.2",
|
|
15
15
|
"bugs": {
|
|
16
16
|
"url": "https://github.com/wemap/wemap-modules-js/issues"
|
|
17
17
|
},
|
|
@@ -32,5 +32,5 @@
|
|
|
32
32
|
"lodash.isnumber": "^3.0.3",
|
|
33
33
|
"sax": "^1.2.4"
|
|
34
34
|
},
|
|
35
|
-
"gitHead": "
|
|
35
|
+
"gitHead": "80a8bdd92acfffd6ca612ec56e882ad54aa115e1"
|
|
36
36
|
}
|
package/src/osrm/OsrmUtils.js
CHANGED
|
@@ -151,14 +151,14 @@ class OsrmUtils {
|
|
|
151
151
|
/**
|
|
152
152
|
* Generate Itinerary from OSRM JSON, start and end.
|
|
153
153
|
* @param {Object} json JSON file provided by OSRM.
|
|
154
|
-
* @param {
|
|
155
|
-
* @param {
|
|
154
|
+
* @param {WGS84} start itinerary start
|
|
155
|
+
* @param {WGS84} end itinerary end
|
|
156
156
|
*/
|
|
157
157
|
static createItineraryFromJson(json, start, end) {
|
|
158
158
|
const itinerary = new Itinerary();
|
|
159
159
|
|
|
160
|
-
itinerary.start =
|
|
161
|
-
itinerary.end =
|
|
160
|
+
itinerary.start = start;
|
|
161
|
+
itinerary.end = end;
|
|
162
162
|
|
|
163
163
|
const {
|
|
164
164
|
legs, geometry
|
|
@@ -26,8 +26,8 @@ describe('OsrmUtils', () => {
|
|
|
26
26
|
|
|
27
27
|
const json = JSON.parse(fileString);
|
|
28
28
|
|
|
29
|
-
const start =
|
|
30
|
-
const end =
|
|
29
|
+
const start = new WGS84(43.6007871, 3.8757218000000004);
|
|
30
|
+
const end = new WGS84(43.598877, 3.873866);
|
|
31
31
|
|
|
32
32
|
const itinerary = OsrmUtils.createItineraryFromJson(json, start, end);
|
|
33
33
|
|
|
@@ -202,10 +202,7 @@ describe('OsrmUtils', () => {
|
|
|
202
202
|
|
|
203
203
|
const json = osrmWemapJson;
|
|
204
204
|
|
|
205
|
-
const
|
|
206
|
-
const end = OsrmUtils.wgs84ToJson(itineraryEnd);
|
|
207
|
-
|
|
208
|
-
const itinerary = OsrmUtils.createItineraryFromJson(json, start, end);
|
|
205
|
+
const itinerary = OsrmUtils.createItineraryFromJson(json, itineraryStart, itineraryEnd);
|
|
209
206
|
|
|
210
207
|
expect(itinerary.nodes.length).equal(wemapItinerary.nodes.length);
|
|
211
208
|
for (let i = 0; i < itinerary.nodes.length; i++) {
|