@wemap/providers 8.0.0-alpha.0 → 8.0.0
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/index.js
CHANGED
|
@@ -5,6 +5,8 @@ export * as Providers from './src/Providers.js';
|
|
|
5
5
|
export { default as ProvidersInterface } from './src/ProvidersInterface.js';
|
|
6
6
|
export { default as ProvidersOptions } from './src/ProvidersOptions.js';
|
|
7
7
|
|
|
8
|
+
export { default as MapMatchingHandler } from './src/mapmatching/MapMatchingHandler.js';
|
|
9
|
+
|
|
8
10
|
export { default as PositionSmoother } from './src/smoothers/PositionSmoother.js';
|
|
9
11
|
export { default as AttitudeSmoother } from './src/smoothers/AttitudeSmoother.js';
|
|
10
12
|
|
package/package.json
CHANGED
|
@@ -23,19 +23,19 @@ import ProvidersOptions from '../ProvidersOptions.js';
|
|
|
23
23
|
class MapMatchingHandler extends Provider {
|
|
24
24
|
|
|
25
25
|
/** @type {number} in radians */
|
|
26
|
-
static
|
|
26
|
+
static DEFAULT_MM_MAX_ANGLE = deg2rad(30);
|
|
27
27
|
|
|
28
28
|
/** @type {number} in meters */
|
|
29
|
-
static
|
|
29
|
+
static DEFAULT_MM_MAX_DIST = 30;
|
|
30
30
|
|
|
31
31
|
/** @type {number} in meters */
|
|
32
|
-
static
|
|
32
|
+
static DEFAULT_MM_MIN_DIST = 0;
|
|
33
33
|
|
|
34
34
|
/** @type {boolean} */
|
|
35
|
-
static
|
|
35
|
+
static DEFAULT_USE_ITINERARY_START_AS_POSITION = false;
|
|
36
36
|
|
|
37
37
|
/** @type {boolean} */
|
|
38
|
-
static
|
|
38
|
+
static ORIENTATION_MATCHING = true;
|
|
39
39
|
|
|
40
40
|
/** @type {number} in meters */
|
|
41
41
|
static MM_HUGE_JUMP_DISTANCE = 3;
|
|
@@ -84,9 +84,10 @@ class MapMatchingHandler extends Provider {
|
|
|
84
84
|
super();
|
|
85
85
|
|
|
86
86
|
this._mapMatching = new MapMatching();
|
|
87
|
-
this._mapMatching.maxDistance = MapMatchingHandler.
|
|
88
|
-
this._mapMatching.maxAngleBearing = MapMatchingHandler.
|
|
89
|
-
this._mapMatchingMinDistance = MapMatchingHandler.
|
|
87
|
+
this._mapMatching.maxDistance = MapMatchingHandler.DEFAULT_MM_MAX_DIST;
|
|
88
|
+
this._mapMatching.maxAngleBearing = MapMatchingHandler.DEFAULT_MM_MAX_ANGLE;
|
|
89
|
+
this._mapMatchingMinDistance = MapMatchingHandler.DEFAULT_MM_MIN_DIST;
|
|
90
|
+
this._useItineraryStartAsPosition = MapMatchingHandler.DEFAULT_USE_ITINERARY_START_AS_POSITION;
|
|
90
91
|
}
|
|
91
92
|
|
|
92
93
|
/**
|
|
@@ -187,7 +188,7 @@ class MapMatchingHandler extends Provider {
|
|
|
187
188
|
*/
|
|
188
189
|
_notifyPositionFromItineraryInput(itinerary) {
|
|
189
190
|
|
|
190
|
-
if (!
|
|
191
|
+
if (!this._useItineraryStartAsPosition || itinerary.start) {
|
|
191
192
|
return;
|
|
192
193
|
}
|
|
193
194
|
|
|
@@ -508,6 +509,14 @@ class MapMatchingHandler extends Provider {
|
|
|
508
509
|
set maxAngleBearing(maxAngleBearing) {
|
|
509
510
|
this._mapMatching.maxAngleBearing = maxAngleBearing;
|
|
510
511
|
}
|
|
512
|
+
|
|
513
|
+
get useItineraryStartAsPosition() {
|
|
514
|
+
return this._useItineraryStartAsPosition;
|
|
515
|
+
}
|
|
516
|
+
|
|
517
|
+
set useItineraryStartAsPosition(useItineraryStartAsPosition) {
|
|
518
|
+
this._useItineraryStartAsPosition = useItineraryStartAsPosition;
|
|
519
|
+
}
|
|
511
520
|
}
|
|
512
521
|
|
|
513
522
|
export default new MapMatchingHandler();
|