@wemap/geo 4.0.0 → 4.0.1
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 +2 -2
- package/src/graph/MapMatching.js +5 -2
- package/src/graph/Step.js +10 -0
package/package.json
CHANGED
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
"directory": "packages/geo"
|
|
13
13
|
},
|
|
14
14
|
"name": "@wemap/geo",
|
|
15
|
-
"version": "4.0.
|
|
15
|
+
"version": "4.0.1",
|
|
16
16
|
"bugs": {
|
|
17
17
|
"url": "https://github.com/wemap/wemap-modules-js/issues"
|
|
18
18
|
},
|
|
@@ -30,5 +30,5 @@
|
|
|
30
30
|
"@wemap/logger": "^4.0.0",
|
|
31
31
|
"@wemap/maths": "^4.0.0"
|
|
32
32
|
},
|
|
33
|
-
"gitHead": "
|
|
33
|
+
"gitHead": "ba5cebf23d528021d4bd1a3498d51d98ac655fb9"
|
|
34
34
|
}
|
package/src/graph/MapMatching.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/* eslint-disable complexity */
|
|
1
2
|
/* eslint-disable max-statements */
|
|
2
3
|
import { diffAngleLines } from '@wemap/maths';
|
|
3
4
|
|
|
@@ -170,7 +171,8 @@ class MapMatching {
|
|
|
170
171
|
projection.projection = edge.node1.coords.clone();
|
|
171
172
|
MapMatching._updateProjectionLevelFromEdge(edge, projection.projection);
|
|
172
173
|
|
|
173
|
-
if (distNode1 <= Constants.EPS_MM
|
|
174
|
+
if (distNode1 <= Constants.EPS_MM
|
|
175
|
+
&& location.level === edge.node1.coords.level) {
|
|
174
176
|
break;
|
|
175
177
|
}
|
|
176
178
|
}
|
|
@@ -186,7 +188,8 @@ class MapMatching {
|
|
|
186
188
|
projection.projection = edge.node2.coords.clone();
|
|
187
189
|
MapMatching._updateProjectionLevelFromEdge(edge, projection.projection);
|
|
188
190
|
|
|
189
|
-
if (distNode2 <= Constants.EPS_MM
|
|
191
|
+
if (distNode2 <= Constants.EPS_MM
|
|
192
|
+
&& location.level === edge.node2.coords.level) {
|
|
190
193
|
break;
|
|
191
194
|
}
|
|
192
195
|
}
|
package/src/graph/Step.js
CHANGED
|
@@ -36,6 +36,16 @@ class Step {
|
|
|
36
36
|
/** @type {number} */
|
|
37
37
|
_length = 0;
|
|
38
38
|
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* @param {object} obj
|
|
42
|
+
*/
|
|
43
|
+
constructor(obj) {
|
|
44
|
+
if (typeof obj === 'object') {
|
|
45
|
+
Object.assign(this, obj);
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
|
|
39
49
|
/** @type {Node} */
|
|
40
50
|
get node() {
|
|
41
51
|
return this.nodes[0];
|