@wemap/providers 14.5.10-beta.1 → 14.5.10-beta.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/dist/index.js +28 -17
- package/dist/src/events/AbsolutePosition.d.ts +13 -0
- package/dist/src/events/AbsolutePosition.d.ts.map +1 -0
- package/dist/src/events/Types.d.ts +2 -3
- package/dist/src/events/Types.d.ts.map +1 -1
- package/dist/src/providers/position/absolute/AbsolutePositionProvider.d.ts +1 -1
- package/dist/src/providers/position/absolute/AbsolutePositionProvider.d.ts.map +1 -1
- package/package.json +7 -7
package/dist/index.js
CHANGED
|
@@ -2,7 +2,16 @@ import { AbsoluteHeading, Attitude, Constants, GeoRelativePosition, Level, Relat
|
|
|
2
2
|
import { Edge, ItineraryInfoManager } from "@wemap/routers";
|
|
3
3
|
import { Browser, BrowserUtils, TimeUtils, UserAgentUtils } from "@wemap/utils";
|
|
4
4
|
import { Camera, SharedCameras, base64ToCanvas, canvasToBase64, reduceImageSize } from "@wemap/camera";
|
|
5
|
-
var
|
|
5
|
+
var AbsolutePosition = class e extends UserPosition {
|
|
6
|
+
source;
|
|
7
|
+
static fromUserPosition(C, w) {
|
|
8
|
+
let T = new e(C.lat, C.lng, C.alt, C.level, C.time, C.accuracy, C.bearing);
|
|
9
|
+
return T.source = w, T;
|
|
10
|
+
}
|
|
11
|
+
clone() {
|
|
12
|
+
return e.fromUserPosition(super.clone(), this.source);
|
|
13
|
+
}
|
|
14
|
+
}, RelativeAttitude = class extends Attitude {}, AbsoluteAttitude = class extends Attitude {}, ProvidersOptions_default = {
|
|
6
15
|
useMapMatching: !0,
|
|
7
16
|
ignoreProviders: [],
|
|
8
17
|
optionalProviders: [],
|
|
@@ -3052,7 +3061,7 @@ var field = function(e, C, w) {
|
|
|
3052
3061
|
}
|
|
3053
3062
|
}(), package_default = {
|
|
3054
3063
|
name: "@wemap/providers",
|
|
3055
|
-
version: "14.5.10-beta.
|
|
3064
|
+
version: "14.5.10-beta.1",
|
|
3056
3065
|
type: "module",
|
|
3057
3066
|
publishConfig: { access: "public" },
|
|
3058
3067
|
main: "./dist/index.js",
|
|
@@ -3063,12 +3072,12 @@ var field = function(e, C, w) {
|
|
|
3063
3072
|
} },
|
|
3064
3073
|
files: ["dist"],
|
|
3065
3074
|
dependencies: {
|
|
3066
|
-
"@wemap/camera": "14.5.10-beta.
|
|
3067
|
-
"@wemap/core": "14.5.10-beta.
|
|
3068
|
-
"@wemap/geo": "14.5.10-beta.
|
|
3069
|
-
"@wemap/osm": "14.5.10-beta.
|
|
3070
|
-
"@wemap/routers": "14.5.10-beta.
|
|
3071
|
-
"@wemap/utils": "14.5.10-beta.
|
|
3075
|
+
"@wemap/camera": "14.5.10-beta.1",
|
|
3076
|
+
"@wemap/core": "14.5.10-beta.1",
|
|
3077
|
+
"@wemap/geo": "14.5.10-beta.1",
|
|
3078
|
+
"@wemap/osm": "14.5.10-beta.1",
|
|
3079
|
+
"@wemap/routers": "14.5.10-beta.1",
|
|
3080
|
+
"@wemap/utils": "14.5.10-beta.1"
|
|
3072
3081
|
},
|
|
3073
3082
|
devDependencies: {
|
|
3074
3083
|
"@wemap/logger-legacy": "^13.3.0",
|
|
@@ -3527,9 +3536,9 @@ var field = function(e, C, w) {
|
|
|
3527
3536
|
}), this._gnssWifiProviderId = GnssWifiProvider_default.addEventListener((e) => {
|
|
3528
3537
|
if (this.ignoreGnssWifi) return;
|
|
3529
3538
|
let C = e.clone();
|
|
3530
|
-
C.bearing = null, this._onAbsolutePosition(C, !1);
|
|
3531
|
-
}), this._vpsProviderId = VpsProvider_default.addEventListener((e) => this._onAbsolutePosition(e.absolutePosition), this.notifyError, !1), ProvidersOptions_default.hasPoleStar && (this._polestarProviderId = PoleStarProvider_default.addEventListener((e) => {
|
|
3532
|
-
if (this._lastPolestarFix = TimeUtils.preciseTime(), !this._onAbsolutePosition(e) && this.lastEvent?.level === null) {
|
|
3539
|
+
C.bearing = null, this._onAbsolutePosition(C, "gnss-wifi", !1);
|
|
3540
|
+
}), this._vpsProviderId = VpsProvider_default.addEventListener((e) => this._onAbsolutePosition(e.absolutePosition, "vps"), this.notifyError, !1), ProvidersOptions_default.hasPoleStar && (this._polestarProviderId = PoleStarProvider_default.addEventListener((e) => {
|
|
3541
|
+
if (this._lastPolestarFix = TimeUtils.preciseTime(), !this._onAbsolutePosition(e, "polestar") && this.lastEvent?.level === null) {
|
|
3533
3542
|
let C = this.lastEvent.clone();
|
|
3534
3543
|
C.level = e.level, this.notify(C);
|
|
3535
3544
|
}
|
|
@@ -3548,22 +3557,24 @@ var field = function(e, C, w) {
|
|
|
3548
3557
|
let A = k && T.accuracy <= D.accuracy;
|
|
3549
3558
|
return !!(O && A || w && !Level.equals(T.level, D.level));
|
|
3550
3559
|
}
|
|
3551
|
-
_onAbsolutePosition(e, C = !0) {
|
|
3552
|
-
if (!this._shouldTakeIntoAccountNewAbsolutePosition(e,
|
|
3553
|
-
let
|
|
3554
|
-
return
|
|
3560
|
+
_onAbsolutePosition(e, C, w = !0) {
|
|
3561
|
+
if (!this._shouldTakeIntoAccountNewAbsolutePosition(e, w) && !this.useAllAbsolutePositions) return !1;
|
|
3562
|
+
let T = AbsolutePosition.fromUserPosition(e, C), E = this.lastEvent ? this.lastEvent : null;
|
|
3563
|
+
return E && (w || (T.level = E.level), T.bearing === null && (T.bearing = E.bearing)), MapMatchingHandler_default.canUseMapMatching() ? MapMatchingHandler_default.notifyPositionFromAbsolute(T) : (this.notify(T), !0);
|
|
3555
3564
|
}
|
|
3556
3565
|
_onRelativePosition(e) {
|
|
3557
3566
|
if (!this.lastEvent || this._waitUntilNextVpsPosition) return !1;
|
|
3558
3567
|
let C = this.lastEvent, w = e, T = Math.sqrt(w.x ** 2 + w.y ** 2), E = Math.atan2(w.x, w.y), D = C.alt === null ? null : w.z, O = C.destinationPoint(T, E, D);
|
|
3559
|
-
|
|
3568
|
+
O.bearing = w.bearing, O.time = w.time, O.accuracy += w.accuracy;
|
|
3569
|
+
let k = AbsolutePosition.fromUserPosition(O, "relative");
|
|
3570
|
+
return MapMatchingHandler_default.canUseMapMatching() ? MapMatchingHandler_default.notifyPositionFromRelative(k) : (this.notify(k), !0);
|
|
3560
3571
|
}
|
|
3561
3572
|
feed(C) {
|
|
3562
3573
|
let w;
|
|
3563
3574
|
if (C instanceof UserPosition) {
|
|
3564
3575
|
if (C.time === null) throw Error("the time of the position is not defined");
|
|
3565
3576
|
if (C.accuracy === null) throw Error("the accuracy of the position is not defined");
|
|
3566
|
-
w = C;
|
|
3577
|
+
w = AbsolutePosition.fromUserPosition(C, C.source ?? "feed");
|
|
3567
3578
|
} else throw Error("data is nor an UserPosition or an AbsolutePositionEvent");
|
|
3568
3579
|
if (!e.USE_MM_FOR_FEED || !MapMatchingHandler_default.canUseMapMatching()) {
|
|
3569
3580
|
this.notify(w);
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { UserPosition } from '../../../geo';
|
|
2
|
+
/**
|
|
3
|
+
* Which underlying provider produced an {@link AbsolutePosition}. This lives on the provider
|
|
4
|
+
* event — NOT on {@link UserPosition}, which stays a plain value object — so consumers can tell a
|
|
5
|
+
* precise VPS fix from a noisy GnssWifi one or a dead-reckoned (relative) update.
|
|
6
|
+
*/
|
|
7
|
+
export type PositionSource = 'vps' | 'gnss-wifi' | 'relative' | 'polestar' | 'feed';
|
|
8
|
+
export declare class AbsolutePosition extends UserPosition {
|
|
9
|
+
source?: PositionSource;
|
|
10
|
+
static fromUserPosition(position: UserPosition, source?: PositionSource): AbsolutePosition;
|
|
11
|
+
clone(): AbsolutePosition;
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=AbsolutePosition.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AbsolutePosition.d.ts","sourceRoot":"","sources":["../../../src/events/AbsolutePosition.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAE1C;;;;GAIG;AACH,MAAM,MAAM,cAAc,GAAG,KAAK,GAAG,WAAW,GAAG,UAAU,GAAG,UAAU,GAAG,MAAM,CAAC;AAEpF,qBAAa,gBAAiB,SAAQ,YAAY;IAE9C,MAAM,CAAC,EAAE,cAAc,CAAC;IAExB,MAAM,CAAC,gBAAgB,CAAC,QAAQ,EAAE,YAAY,EAAE,MAAM,CAAC,EAAE,cAAc,GAAG,gBAAgB;IAW1F,KAAK,IAAI,gBAAgB;CAG5B"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { Attitude
|
|
1
|
+
import { Attitude } from '../../../geo';
|
|
2
2
|
import { Vector16_t, Vector3_t } from '@wemap/maths-legacy';
|
|
3
|
+
export { AbsolutePosition, type PositionSource } from './AbsolutePosition';
|
|
3
4
|
export type Acceleration = Readonly<{
|
|
4
5
|
readonly timestamp: number;
|
|
5
6
|
readonly values: Vector3_t;
|
|
@@ -18,8 +19,6 @@ export declare class RelativeAttitude extends Attitude {
|
|
|
18
19
|
}
|
|
19
20
|
export declare class AbsoluteAttitude extends Attitude {
|
|
20
21
|
}
|
|
21
|
-
export declare class AbsolutePosition extends UserPosition {
|
|
22
|
-
}
|
|
23
22
|
export type Inclination = number;
|
|
24
23
|
export type Barcode = string;
|
|
25
24
|
export type Step = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Types.d.ts","sourceRoot":"","sources":["../../../src/events/Types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,
|
|
1
|
+
{"version":3,"file":"Types.d.ts","sourceRoot":"","sources":["../../../src/events/Types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,KAAK,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAEjE,OAAO,EAAE,gBAAgB,EAAE,KAAK,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAE3E,MAAM,MAAM,YAAY,GAAG,QAAQ,CAAC;IAAE,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,MAAM,EAAE,SAAS,CAAC;CAAE,CAAC,CAAA;AAChG,MAAM,MAAM,WAAW,GAAG,QAAQ,CAAC;IAAE,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,MAAM,EAAE,SAAS,CAAC;CAAE,CAAC,CAAA;AAC/F,MAAM,MAAM,YAAY,GAAG,QAAQ,CAAC;IAAE,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;CAAE,CAAC,CAAA;AACpE,MAAM,MAAM,2BAA2B,GAAG,QAAQ,CAAC;IAAE,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;CAAE,CAAC,CAAA;AAC/E,qBAAa,gBAAiB,SAAQ,QAAQ;CAAI;AAClD,qBAAa,gBAAiB,SAAQ,QAAQ;CAAI;AAElD,MAAM,MAAM,WAAW,GAAG,MAAM,CAAC;AACjC,MAAM,MAAM,OAAO,GAAG,MAAM,CAAC;AAC7B,MAAM,MAAM,IAAI,GAAG;IAAE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;CAAE,CAAA;AACtE,MAAM,MAAM,IAAI,GAAG;IAAE,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;CAAE,CAAA;AAClD,MAAM,MAAM,YAAY,GAAG,OAAO,CAAC;AACnC,MAAM,MAAM,sBAAsB,GAAG,UAAU,CAAC;AAChD,MAAM,MAAM,iBAAiB,GAAG,SAAS,GAAG,SAAS,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { GeoRelativePosition } from '../../../../../geo';
|
|
2
2
|
import { default as Provider } from '../../Provider';
|
|
3
|
-
import { AbsolutePosition } from '../../../events/
|
|
3
|
+
import { AbsolutePosition } from '../../../events/AbsolutePosition';
|
|
4
4
|
declare class AbsolutePositionProvider extends Provider<AbsolutePosition> {
|
|
5
5
|
static ACCURACY_RELOC_RATIO: number;
|
|
6
6
|
static USE_MM_FOR_FEED: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AbsolutePositionProvider.d.ts","sourceRoot":"","sources":["../../../../../src/providers/position/absolute/AbsolutePositionProvider.ts"],"names":[],"mappings":"AAAA,OAAO,EAAS,mBAAmB,EAAgB,MAAM,YAAY,CAAC;AAGtE,OAAO,QAAQ,MAAM,gBAAgB,CAAC;AAQtC,OAAO,EAAE,gBAAgB,
|
|
1
|
+
{"version":3,"file":"AbsolutePositionProvider.d.ts","sourceRoot":"","sources":["../../../../../src/providers/position/absolute/AbsolutePositionProvider.ts"],"names":[],"mappings":"AAAA,OAAO,EAAS,mBAAmB,EAAgB,MAAM,YAAY,CAAC;AAGtE,OAAO,QAAQ,MAAM,gBAAgB,CAAC;AAQtC,OAAO,EAAE,gBAAgB,EAAuB,MAAM,kCAAkC,CAAC;AAEzF,cAAM,wBAAyB,SAAQ,QAAQ,CAAC,gBAAgB,CAAC;IAG7D,MAAM,CAAC,oBAAoB,SAAK;IAChC,MAAM,CAAC,eAAe,UAAQ;IAE9B,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,2BAA2B,CAAC,EAAE,MAAM,CAAC;IACrC,qBAAqB,CAAC,EAAE,MAAM,CAAC;IAE/B,uBAAuB,UAAS;IAChC,yBAAyB,UAAS;IAClC,gBAAgB,EAAE,MAAM,GAAG,IAAI,CAAQ;IAEvC;;;;;;OAMG;IACH,cAAc,UAAS;IAEvB,OAAO,eAA4B;IAGnC,YAAY;IAUZ,KAAK;IAwDL;;OAEG;IACH,IAAI;IAsBJ,OAAO,CAAC,yCAAyC;IA8CjD;;OAEG;IACH,OAAO,CAAC,mBAAmB;IAkC3B;;OAEG;IACH,mBAAmB,CAAC,aAAa,EAAE,mBAAmB;IAgCtD,IAAI,CAAC,IAAI,EAAE,gBAAgB;IA4B3B,oBAAoB,CAAC,GAAG,sBAAsB,EAAE,CAAC,gBAAgB,GAAG,IAAI,CAAC,EAAE;CAc9E;;AAED,wBAA8C"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wemap/providers",
|
|
3
|
-
"version": "14.5.10-beta.
|
|
3
|
+
"version": "14.5.10-beta.2",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -17,12 +17,12 @@
|
|
|
17
17
|
"dist"
|
|
18
18
|
],
|
|
19
19
|
"dependencies": {
|
|
20
|
-
"@wemap/camera": "14.5.10-beta.
|
|
21
|
-
"@wemap/core": "14.5.10-beta.
|
|
22
|
-
"@wemap/geo": "14.5.10-beta.
|
|
23
|
-
"@wemap/osm": "14.5.10-beta.
|
|
24
|
-
"@wemap/routers": "14.5.10-beta.
|
|
25
|
-
"@wemap/utils": "14.5.10-beta.
|
|
20
|
+
"@wemap/camera": "14.5.10-beta.2",
|
|
21
|
+
"@wemap/core": "14.5.10-beta.2",
|
|
22
|
+
"@wemap/geo": "14.5.10-beta.2",
|
|
23
|
+
"@wemap/osm": "14.5.10-beta.2",
|
|
24
|
+
"@wemap/routers": "14.5.10-beta.2",
|
|
25
|
+
"@wemap/utils": "14.5.10-beta.2"
|
|
26
26
|
},
|
|
27
27
|
"devDependencies": {
|
|
28
28
|
"@wemap/logger-legacy": "^13.3.0",
|