@wemap/osm 2.7.4 → 2.7.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": "2.7.
|
|
14
|
+
"version": "2.7.6",
|
|
15
15
|
"bugs": {
|
|
16
16
|
"url": "https://github.com/wemap/wemap-modules-js/issues"
|
|
17
17
|
},
|
|
@@ -26,11 +26,11 @@
|
|
|
26
26
|
],
|
|
27
27
|
"license": "ISC",
|
|
28
28
|
"dependencies": {
|
|
29
|
-
"@wemap/geo": "^2.7.
|
|
30
|
-
"@wemap/graph": "^2.7.
|
|
29
|
+
"@wemap/geo": "^2.7.6",
|
|
30
|
+
"@wemap/graph": "^2.7.6",
|
|
31
31
|
"@wemap/logger": "^2.7.0",
|
|
32
32
|
"lodash.isnumber": "^3.0.3",
|
|
33
33
|
"sax": "^1.2.4"
|
|
34
34
|
},
|
|
35
|
-
"gitHead": "
|
|
35
|
+
"gitHead": "46ba2de050542dacd2b0fd9a0e07cb03f1aedbc7"
|
|
36
36
|
}
|
package/src/osrm/OsrmUtils.js
CHANGED
|
@@ -231,9 +231,12 @@ class OsrmUtils {
|
|
|
231
231
|
}
|
|
232
232
|
step.nodes.push(node);
|
|
233
233
|
|
|
234
|
+
const isFirstNode = coordinates[0] === coords;
|
|
234
235
|
const isLastNode = coordinates[coordinates.length - 1] === coords;
|
|
235
|
-
if (
|
|
236
|
+
if (isFirstNode) {
|
|
236
237
|
itinerary._nextStepsIndexes.push(i);
|
|
238
|
+
} else if (!isLastNode) {
|
|
239
|
+
itinerary._nextStepsIndexes.push(i + 1);
|
|
237
240
|
}
|
|
238
241
|
|
|
239
242
|
if (previousNode) {
|
|
@@ -85,13 +85,13 @@ describe('OsrmUtils', () => {
|
|
|
85
85
|
expect(step.name).equals('Rue du Docteur Louis Perrier');
|
|
86
86
|
|
|
87
87
|
expect(itinerary._nextStepsIndexes.length).equals(itinerary.nodes.length);
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
}
|
|
91
|
-
for (let i = 5; i <= 15; i++) {
|
|
88
|
+
expect(itinerary._nextStepsIndexes[0]).equals(0);
|
|
89
|
+
for (let i = 1; i <= 5; i++) {
|
|
92
90
|
expect(itinerary._nextStepsIndexes[i]).equals(1);
|
|
93
91
|
}
|
|
94
|
-
|
|
92
|
+
for (let i = 6; i <= 16; i++) {
|
|
93
|
+
expect(itinerary._nextStepsIndexes[i]).equals(2);
|
|
94
|
+
}
|
|
95
95
|
expect(itinerary._nextStepsIndexes[17]).equals(3);
|
|
96
96
|
expect(itinerary._nextStepsIndexes[18]).equals(4);
|
|
97
97
|
});
|