@wemap/positioning 14.6.0-beta.4 → 14.6.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/dist/index.d.ts +0 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +91 -76
- package/dist/src/ILocationSource.d.ts +13 -1
- package/dist/src/ILocationSource.d.ts.map +1 -1
- package/dist/src/MapMatching.d.ts +2 -2
- package/dist/src/location-sources/GnssWifiLocationSource.d.ts +2 -0
- package/dist/src/location-sources/GnssWifiLocationSource.d.ts.map +1 -1
- package/dist/src/location-sources/LocationSource.d.ts +15 -0
- package/dist/src/location-sources/LocationSource.d.ts.map +1 -1
- package/dist/src/location-sources/VPSLocationSource.d.ts +2 -0
- package/dist/src/location-sources/VPSLocationSource.d.ts.map +1 -1
- package/dist/src/types.d.ts +10 -8
- package/dist/src/types.d.ts.map +1 -1
- package/package.json +6 -6
- package/dist/vitest.config.d.ts +0 -3
- package/dist/vitest.config.d.ts.map +0 -1
package/dist/index.d.ts
CHANGED
|
@@ -11,9 +11,6 @@ export { GnssWifiLocationSource } from './src/location-sources/GnssWifiLocationS
|
|
|
11
11
|
export type { GnssWifiLocationSourceConfig } from './src/location-sources/GnssWifiLocationSource';
|
|
12
12
|
export { MapMatching } from './src/MapMatching';
|
|
13
13
|
export { requestSensorPermissions, requestLocationPermissions } from './src/utils/permissions';
|
|
14
|
-
/**
|
|
15
|
-
* @internal
|
|
16
|
-
*/
|
|
17
14
|
export { Coordinates, UserPosition } from '@wemap/geo';
|
|
18
15
|
export type { Pose, PartialPose } from './src/types';
|
|
19
16
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,YAAY,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAG7D,OAAO,EAAE,cAAc,EAAE,MAAM,uCAAuC,CAAC;AAGvE,OAAO,EAAE,iBAAiB,EAAE,MAAM,0CAA0C,CAAC;AAC7E,YAAY,EAAE,uBAAuB,EAAE,MAAM,0CAA0C,CAAC;AAExF,OAAO,EAAE,sBAAsB,EAAE,MAAM,+CAA+C,CAAC;AACvF,YAAY,EAAE,4BAA4B,EAAE,MAAM,+CAA+C,CAAC;AAGlG,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAGhD,OAAO,EAAE,wBAAwB,EAAE,0BAA0B,EAAE,MAAM,yBAAyB,CAAC;AAG/F
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,YAAY,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAG7D,OAAO,EAAE,cAAc,EAAE,MAAM,uCAAuC,CAAC;AAGvE,OAAO,EAAE,iBAAiB,EAAE,MAAM,0CAA0C,CAAC;AAC7E,YAAY,EAAE,uBAAuB,EAAE,MAAM,0CAA0C,CAAC;AAExF,OAAO,EAAE,sBAAsB,EAAE,MAAM,+CAA+C,CAAC;AACvF,YAAY,EAAE,4BAA4B,EAAE,MAAM,+CAA+C,CAAC;AAGlG,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAGhD,OAAO,EAAE,wBAAwB,EAAE,0BAA0B,EAAE,MAAM,yBAAyB,CAAC;AAG/F,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAGvD,YAAY,EAAE,IAAI,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,13 +1,17 @@
|
|
|
1
|
-
import { AbsoluteAttitudeProvider, AbsolutePositionProvider, GnssWifiProvider, MapMatchingHandler, PositionSmoother, ProvidersOptions, VpsBackgroundScanner, VpsProvider } from "@wemap/providers";
|
|
2
|
-
import { CoreConfig } from "@wemap/core";
|
|
3
|
-
import { Coordinates, UserPosition } from "@wemap/geo";
|
|
4
|
-
|
|
1
|
+
import { AbsoluteAttitudeProvider as e, AbsolutePositionProvider as t, GnssWifiProvider as n, MapMatchingHandler as r, PositionSmoother as i, ProvidersOptions as a, VpsBackgroundScanner as o, VpsProvider as s } from "@wemap/providers";
|
|
2
|
+
import { CoreConfig as c } from "@wemap/core";
|
|
3
|
+
import { Coordinates as l, UserPosition as u } from "@wemap/geo";
|
|
4
|
+
//#region src/location-sources/LocationSource.ts
|
|
5
|
+
var d = class {
|
|
5
6
|
currentPose = {};
|
|
6
7
|
updateCallbacks = /* @__PURE__ */ new Set();
|
|
7
8
|
errorCallbacks = /* @__PURE__ */ new Set();
|
|
8
9
|
isStarted = !1;
|
|
9
10
|
_locationState = "no_positioning";
|
|
10
11
|
locationStateCallbacks = /* @__PURE__ */ new Set();
|
|
12
|
+
async dispose() {
|
|
13
|
+
await this.stop(), this.updateCallbacks.clear(), this.errorCallbacks.clear(), this.locationStateCallbacks.clear();
|
|
14
|
+
}
|
|
11
15
|
onUpdate(e) {
|
|
12
16
|
if (this.updateCallbacks.add(e), Object.keys(this.currentPose).length > 0) try {
|
|
13
17
|
e({ ...this.currentPose });
|
|
@@ -25,24 +29,24 @@ var LocationSource = class {
|
|
|
25
29
|
this.errorCallbacks.delete(e);
|
|
26
30
|
}
|
|
27
31
|
configureMapMatching(e) {
|
|
28
|
-
e?.
|
|
32
|
+
e?.maxDistance !== void 0 && (r.maxDistance = e.maxDistance), e?.maxAngleBearing !== void 0 && (r.maxAngleBearing = e.maxAngleBearing), e?.maxDistance === void 0 && (r.maxDistance = 30), e?.useOrientationMatching !== void 0 && (r.useOrientationMatching = e.useOrientationMatching), e?.useStrict !== void 0 && (r.useStrict = e.useStrict);
|
|
29
33
|
}
|
|
30
34
|
mergeAndEmitUpdate(e) {
|
|
31
35
|
e.position !== void 0 && (this.currentPose.position = e.position), e.attitude !== void 0 && (this.currentPose.attitude = e.attitude), e.inclination !== void 0 && (this.currentPose.inclination = e.inclination), e.time !== void 0 && (this.currentPose.time = e.time), e.accuracy !== void 0 && (this.currentPose.accuracy = e.accuracy), this.emitUpdate({ ...this.currentPose });
|
|
32
36
|
}
|
|
33
37
|
emitUpdate(e) {
|
|
34
|
-
this.updateCallbacks.forEach((
|
|
38
|
+
this.updateCallbacks.forEach((t) => {
|
|
35
39
|
try {
|
|
36
|
-
|
|
40
|
+
t(e);
|
|
37
41
|
} catch (e) {
|
|
38
42
|
console.error(`Error in ${this.constructor.name} callback:`, e);
|
|
39
43
|
}
|
|
40
44
|
});
|
|
41
45
|
}
|
|
42
46
|
emitError(e) {
|
|
43
|
-
this.errorCallbacks.forEach((
|
|
47
|
+
this.errorCallbacks.forEach((t) => {
|
|
44
48
|
try {
|
|
45
|
-
|
|
49
|
+
t(e);
|
|
46
50
|
} catch (e) {
|
|
47
51
|
console.error(`Error in ${this.constructor.name} error callback:`, e);
|
|
48
52
|
}
|
|
@@ -58,11 +62,11 @@ var LocationSource = class {
|
|
|
58
62
|
this.locationStateCallbacks.delete(e);
|
|
59
63
|
}
|
|
60
64
|
setLocationState(e) {
|
|
61
|
-
this._locationState !== e && (this._locationState = e, this.locationStateCallbacks.forEach((
|
|
62
|
-
|
|
65
|
+
this._locationState !== e && (this._locationState = e, this.locationStateCallbacks.forEach((t) => {
|
|
66
|
+
t(e);
|
|
63
67
|
}));
|
|
64
68
|
}
|
|
65
|
-
},
|
|
69
|
+
}, f = 3e4, p = !0, m = 50, h = 100, g = class extends d {
|
|
66
70
|
absolutePositionProviderId = null;
|
|
67
71
|
absoluteAttitudeProviderId = null;
|
|
68
72
|
vpsProviderListenerId = null;
|
|
@@ -79,27 +83,28 @@ var LocationSource = class {
|
|
|
79
83
|
scanStatusCallbacks = /* @__PURE__ */ new Set();
|
|
80
84
|
backgroundScanStatusCallbacks = /* @__PURE__ */ new Set();
|
|
81
85
|
backgroundScanner = null;
|
|
86
|
+
backgroundScanStatusUnsubscribe = null;
|
|
82
87
|
lastBackgroundCandidatePosition = null;
|
|
83
88
|
ACCURACY_BACKGROUND_SCAN_THRESHOLD = 15;
|
|
84
89
|
degradedLocationStateThreshold;
|
|
85
90
|
noPositioningLocationStateThreshold;
|
|
86
91
|
constructor(e = {}) {
|
|
87
|
-
super(), this.backgroundScanEnabled = e.vps?.backgroundScan ??
|
|
92
|
+
super(), this.backgroundScanEnabled = e.vps?.backgroundScan ?? p, this.degradedLocationStateThreshold = e.vps?.degradedLocationStateThreshold ?? m, this.noPositioningLocationStateThreshold = e.vps?.noPositioningLocationStateThreshold ?? h, this.configureVpsProvider(e.vps), this.configureMapMatching(e), e.usePositionSmoother !== !1 && (this.positionSmoother = new i((e) => {
|
|
88
93
|
this.mergeAndEmitUpdate({
|
|
89
94
|
position: e,
|
|
90
95
|
time: "time" in e ? e.time : Date.now(),
|
|
91
96
|
accuracy: "accuracy" in e ? e.accuracy : void 0
|
|
92
97
|
});
|
|
93
|
-
})),
|
|
94
|
-
let
|
|
95
|
-
this.backgroundScanner = new
|
|
98
|
+
})), a.ignoreProviders = ["GnssWifi"];
|
|
99
|
+
let t = e.vps?.backgroundScanIntervalMs ?? f;
|
|
100
|
+
this.backgroundScanner = new o({
|
|
96
101
|
enabled: this.backgroundScanEnabled,
|
|
97
|
-
intervalMs:
|
|
102
|
+
intervalMs: t
|
|
98
103
|
}, (e) => this.handleBackgroundVpsEvent(e), (e) => {
|
|
99
104
|
this.emitError(e);
|
|
100
|
-
}), this._backgroundScanStatus = this.backgroundScanEnabled ? "idle" : "disabled", this.backgroundScanner && this.backgroundScanner.onStatusChange((e) => {
|
|
105
|
+
}), this._backgroundScanStatus = this.backgroundScanEnabled ? "idle" : "disabled", this.backgroundScanner && (this.backgroundScanStatusUnsubscribe = this.backgroundScanner.onStatusChange((e) => {
|
|
101
106
|
this.setBackgroundScanStatus(e);
|
|
102
|
-
});
|
|
107
|
+
}));
|
|
103
108
|
}
|
|
104
109
|
get scanStatus() {
|
|
105
110
|
return this._scanStatus;
|
|
@@ -124,67 +129,70 @@ var LocationSource = class {
|
|
|
124
129
|
this.backgroundScanStatusCallbacks.delete(e);
|
|
125
130
|
}
|
|
126
131
|
setScanStatus(e) {
|
|
127
|
-
this._scanStatus !== e && (this._scanStatus = e, this.scanStatusCallbacks.forEach((
|
|
132
|
+
this._scanStatus !== e && (this._scanStatus = e, this.scanStatusCallbacks.forEach((t) => {
|
|
128
133
|
try {
|
|
129
|
-
|
|
134
|
+
t(e);
|
|
130
135
|
} catch (e) {
|
|
131
136
|
console.error("[VPSLocationSource] Error in scanStatus listener", e);
|
|
132
137
|
}
|
|
133
138
|
}));
|
|
134
139
|
}
|
|
135
140
|
setBackgroundScanStatus(e) {
|
|
136
|
-
this._backgroundScanStatus !== e && (this._backgroundScanStatus = e, this.backgroundScanStatusCallbacks.forEach((
|
|
141
|
+
this._backgroundScanStatus !== e && (this._backgroundScanStatus = e, this.backgroundScanStatusCallbacks.forEach((t) => {
|
|
137
142
|
try {
|
|
138
|
-
|
|
143
|
+
t(e);
|
|
139
144
|
} catch (e) {
|
|
140
145
|
console.error("[VPSLocationSource] Error in backgroundScanStatus listener", e);
|
|
141
146
|
}
|
|
142
147
|
}));
|
|
143
148
|
}
|
|
144
149
|
configureVpsProvider(e) {
|
|
145
|
-
let
|
|
146
|
-
if (!
|
|
147
|
-
let
|
|
148
|
-
|
|
149
|
-
let
|
|
150
|
-
|
|
151
|
-
let
|
|
152
|
-
|
|
153
|
-
let
|
|
154
|
-
|
|
150
|
+
let t = c.getConfig()?.arNavigationData?.providers?.vps, n = e?.endpoint ?? t?.endpoint;
|
|
151
|
+
if (!n) throw Error("VPSLocationSource requires an endpoint URL. Provide it in config or ensure CoreConfig is initialized with arNavigationData.providers.vps.endpoint");
|
|
152
|
+
let r = new URL(n);
|
|
153
|
+
r.href += "geopose", s.endpoint = r.toString();
|
|
154
|
+
let i = e?.minInclinationForRequest ?? (t?.minInclinationForRequest ? t.minInclinationForRequest * Math.PI / 180 : void 0);
|
|
155
|
+
i !== void 0 && (s.minInclinationForRequest = i);
|
|
156
|
+
let a = e?.waitTimeMinInclinationForRequest ?? t?.waitTimeMinInclinationForRequest;
|
|
157
|
+
a !== void 0 && (s.waitTimeMinInclinationForRequest = a);
|
|
158
|
+
let o = e?.useCoarsePose ?? t?.useCoarsePose;
|
|
159
|
+
o !== void 0 && (s.useCoarsePose = o), e?.requestCaller !== void 0 && (s.requestCaller = e.requestCaller);
|
|
155
160
|
}
|
|
156
161
|
async start() {
|
|
157
162
|
this.isStarted || (this.setupListeners(), this.isStarted = !0, this.backgroundScanEnabled ? this.backgroundScanner?.schedule() : this.setBackgroundScanStatus("disabled"));
|
|
158
163
|
}
|
|
159
164
|
async stop() {
|
|
160
|
-
this.isStarted && (this.vpsProviderListenerId !== null && (
|
|
165
|
+
this.isStarted && (this.vpsProviderListenerId !== null && (s.removeEventListener(this.vpsProviderListenerId), this.vpsProviderListenerId = null, s.stop()), this.absolutePositionProviderId !== null && (t.removeEventListener(this.absolutePositionProviderId), this.absolutePositionProviderId = null), this.absoluteAttitudeProviderId !== null && (e.removeEventListener(this.absoluteAttitudeProviderId), this.absoluteAttitudeProviderId = null), this.backgroundScanner?.clear(), this.setBackgroundScanStatus(this.backgroundScanEnabled ? "idle" : "disabled"), this.isStarted = !1, this.setLocationState("no_positioning"));
|
|
166
|
+
}
|
|
167
|
+
async dispose() {
|
|
168
|
+
await super.dispose(), this.backgroundScanStatusUnsubscribe?.(), this.backgroundScanStatusUnsubscribe = null, this.backgroundScanner?.clear(), this.scanStatusCallbacks.clear(), this.backgroundScanStatusCallbacks.clear();
|
|
161
169
|
}
|
|
162
170
|
async startScan() {
|
|
163
171
|
return await this.backgroundScanner?.cancelRunningScan(), this.startScanInternal();
|
|
164
172
|
}
|
|
165
173
|
async startScanInternal() {
|
|
166
174
|
if (this.firstScan = !0, this.isStarted || await this.start(), await this.setupListeners(), this.vpsProviderListenerId !== null) return this.scanPromise ?? Promise.resolve(!1);
|
|
167
|
-
let e = await
|
|
175
|
+
let e = await s.getAvailability();
|
|
168
176
|
if (e instanceof Error) throw e;
|
|
169
177
|
return this.setScanStatus("scanning"), this.scanPromise = new Promise((e) => {
|
|
170
|
-
this.scanResolve = e, this.vpsProviderListenerId =
|
|
171
|
-
this.scanResolve = null, this.stopScan(), this.handleVpsEvent(
|
|
172
|
-
}, (
|
|
173
|
-
this.scanResolve = null, this.emitError(
|
|
178
|
+
this.scanResolve = e, this.vpsProviderListenerId = s.addEventListener((t) => {
|
|
179
|
+
this.scanResolve = null, this.stopScan(), this.handleVpsEvent(t), this.backgroundScanner?.schedule(), e(!0);
|
|
180
|
+
}, (t) => {
|
|
181
|
+
this.scanResolve = null, this.emitError(t), this.backgroundScanner?.schedule(), e(!1);
|
|
174
182
|
});
|
|
175
183
|
}), this.scanPromise;
|
|
176
184
|
}
|
|
177
185
|
async stopScan(e = !1) {
|
|
178
|
-
e && this.scanResolve && (this.scanResolve(!1), this.scanResolve = null), this.vpsProviderListenerId !== null && (
|
|
186
|
+
e && this.scanResolve && (this.scanResolve(!1), this.scanResolve = null), this.vpsProviderListenerId !== null && (s.removeEventListener(this.vpsProviderListenerId), this.vpsProviderListenerId = null, s.stop(), this.setScanStatus("stopped"));
|
|
179
187
|
}
|
|
180
188
|
async setupListeners() {
|
|
181
|
-
if (!this.absolutePositionProviderId && this.firstScan && (await
|
|
189
|
+
if (!this.absolutePositionProviderId && this.firstScan && (await t.getAvailability() instanceof Error || (this.absolutePositionProviderId = t.addEventListener((e) => {
|
|
182
190
|
this.scanStatus !== "scanning" && this.handleAbsolutePosition(e);
|
|
183
191
|
}, (e) => {
|
|
184
192
|
this.emitError(e);
|
|
185
193
|
}))), !this.absoluteAttitudeProviderId && this.firstScan) {
|
|
186
|
-
let
|
|
187
|
-
|
|
194
|
+
let t = await e.getAvailability();
|
|
195
|
+
t instanceof Error ? console.warn("AbsoluteAttitudeProvider not available:", t) : this.absoluteAttitudeProviderId = e.addEventListener((e) => {
|
|
188
196
|
this.mergeAndEmitUpdate({
|
|
189
197
|
attitude: e,
|
|
190
198
|
time: "time" in e ? e.time : Date.now()
|
|
@@ -202,37 +210,37 @@ var LocationSource = class {
|
|
|
202
210
|
});
|
|
203
211
|
}
|
|
204
212
|
handleVpsEvent(e) {
|
|
205
|
-
let
|
|
213
|
+
let t = {};
|
|
206
214
|
if (e.absolutePosition) {
|
|
207
|
-
this.registerScanSuccess(e.absolutePosition),
|
|
208
|
-
let
|
|
209
|
-
|
|
215
|
+
this.registerScanSuccess(e.absolutePosition), t.position = e.absolutePosition;
|
|
216
|
+
let n = "time" in e.absolutePosition ? e.absolutePosition.time : Date.now(), r = "accuracy" in e.absolutePosition ? e.absolutePosition.accuracy : void 0;
|
|
217
|
+
t.time = n, r !== void 0 && (t.accuracy = r);
|
|
210
218
|
}
|
|
211
|
-
e.absoluteAttitude && (
|
|
219
|
+
e.absoluteAttitude && (t.attitude = e.absoluteAttitude), this.mergeAndEmitUpdate(t);
|
|
212
220
|
}
|
|
213
221
|
getCurrentAbsolutePosition() {
|
|
214
222
|
let e = this.currentPose.position;
|
|
215
223
|
return !e || !("latitude" in e) || !("longitude" in e) ? null : e;
|
|
216
224
|
}
|
|
217
225
|
handleBackgroundVpsEvent(e) {
|
|
218
|
-
let
|
|
219
|
-
if (!
|
|
226
|
+
let t = e.absolutePosition;
|
|
227
|
+
if (!t) {
|
|
220
228
|
this.backgroundScanner?.schedule();
|
|
221
229
|
return;
|
|
222
230
|
}
|
|
223
|
-
let
|
|
231
|
+
let n = this.getCurrentAbsolutePosition();
|
|
224
232
|
if (!this.lastBackgroundCandidatePosition) {
|
|
225
|
-
if (
|
|
233
|
+
if (n && t.distanceTo(n) < this.ACCURACY_BACKGROUND_SCAN_THRESHOLD) {
|
|
226
234
|
this.handleVpsEvent(e), this.backgroundScanner?.schedule();
|
|
227
235
|
return;
|
|
228
236
|
}
|
|
229
|
-
this.lastBackgroundCandidatePosition =
|
|
237
|
+
this.lastBackgroundCandidatePosition = t, this.backgroundScanner?.runNow();
|
|
230
238
|
return;
|
|
231
239
|
}
|
|
232
|
-
let
|
|
240
|
+
let r = this.lastBackgroundCandidatePosition;
|
|
233
241
|
this.lastBackgroundCandidatePosition = null;
|
|
234
|
-
let
|
|
235
|
-
|
|
242
|
+
let i = !1;
|
|
243
|
+
n && t.distanceTo(n) < this.ACCURACY_BACKGROUND_SCAN_THRESHOLD && (i = !0), !i && r && t.distanceTo(r) < this.ACCURACY_BACKGROUND_SCAN_THRESHOLD && (i = !0), i && this.handleVpsEvent(e), this.backgroundScanner?.schedule();
|
|
236
244
|
}
|
|
237
245
|
registerScanSuccess(e) {
|
|
238
246
|
this.lastScanPosition = e, this.lastPosition = e, this.distanceSinceLastScan = 0, this.setLocationState("accurate");
|
|
@@ -243,34 +251,35 @@ var LocationSource = class {
|
|
|
243
251
|
this.lastPosition = e;
|
|
244
252
|
return;
|
|
245
253
|
}
|
|
246
|
-
let
|
|
247
|
-
this.lastPosition = e, this.lastScanPosition && (this.distanceSinceLastScan +=
|
|
254
|
+
let t = this.lastPosition.distanceTo(e);
|
|
255
|
+
this.lastPosition = e, this.lastScanPosition && (this.distanceSinceLastScan += t, this.distanceSinceLastScan >= this.noPositioningLocationStateThreshold ? this.setLocationState("no_positioning") : this.distanceSinceLastScan >= this.degradedLocationStateThreshold ? this.setLocationState("degraded") : this.setLocationState("accurate"));
|
|
248
256
|
}
|
|
249
|
-
},
|
|
257
|
+
}, _ = class extends d {
|
|
250
258
|
absolutePositionProviderId = null;
|
|
251
259
|
absoluteAttitudeProviderId = null;
|
|
260
|
+
gnssWifiErrorListenerId = null;
|
|
252
261
|
positionSmoother;
|
|
253
262
|
config;
|
|
254
263
|
constructor(e = {}) {
|
|
255
|
-
super(), this.config = e, this.configureGnssWifi(e.gnssWifi), this.configureMapMatching(e), e.usePositionSmoother !== !1 && (this.positionSmoother = new
|
|
264
|
+
super(), this.config = e, this.configureGnssWifi(e.gnssWifi), this.configureMapMatching(e), e.usePositionSmoother !== !1 && (this.positionSmoother = new i((e) => {
|
|
256
265
|
this.mergeAndEmitUpdate({
|
|
257
266
|
position: e,
|
|
258
267
|
time: "time" in e ? e.time : Date.now(),
|
|
259
268
|
accuracy: "accuracy" in e ? e.accuracy : void 0
|
|
260
269
|
});
|
|
261
|
-
})),
|
|
270
|
+
})), this.gnssWifiErrorListenerId = n.addEventListener(() => {}, (e) => {
|
|
262
271
|
this.emitError(e);
|
|
263
272
|
}, !1);
|
|
264
273
|
}
|
|
265
274
|
configureGnssWifi(e) {
|
|
266
|
-
let
|
|
267
|
-
|
|
275
|
+
let t = c.getConfig()?.arNavigationData?.providers, r = e ?? t?.gnssWifi;
|
|
276
|
+
r && (r.discardPositionsAbove !== void 0 && (n.discardPositionsAbove = r.discardPositionsAbove), r.enableHighAccuracy !== void 0 && (n.enableHighAccuracy = r.enableHighAccuracy));
|
|
268
277
|
}
|
|
269
278
|
async start() {
|
|
270
279
|
if (!this.isStarted) try {
|
|
271
|
-
let e = await
|
|
280
|
+
let e = await t.getAvailability();
|
|
272
281
|
if (e instanceof Error) throw e;
|
|
273
|
-
if (this.absolutePositionProviderId =
|
|
282
|
+
if (this.absolutePositionProviderId = t.addEventListener((e) => {
|
|
274
283
|
this.setLocationState("accurate"), this.positionSmoother ? this.positionSmoother.feed(e) : this.mergeAndEmitUpdate({
|
|
275
284
|
position: e,
|
|
276
285
|
time: "time" in e ? e.time : Date.now(),
|
|
@@ -289,8 +298,8 @@ var LocationSource = class {
|
|
|
289
298
|
}
|
|
290
299
|
}
|
|
291
300
|
async startAttitude() {
|
|
292
|
-
let
|
|
293
|
-
|
|
301
|
+
let t = await e.getAvailability();
|
|
302
|
+
t instanceof Error ? console.warn("AbsoluteAttitudeProvider not available:", t) : this.absoluteAttitudeProviderId = e.addEventListener((e) => {
|
|
294
303
|
this.mergeAndEmitUpdate({
|
|
295
304
|
attitude: e,
|
|
296
305
|
time: "time" in e ? e.time : Date.now()
|
|
@@ -300,24 +309,29 @@ var LocationSource = class {
|
|
|
300
309
|
});
|
|
301
310
|
}
|
|
302
311
|
async stopAttitude() {
|
|
303
|
-
this.absoluteAttitudeProviderId !== null && (
|
|
312
|
+
this.absoluteAttitudeProviderId !== null && (e.removeEventListener(this.absoluteAttitudeProviderId), this.absoluteAttitudeProviderId = null);
|
|
304
313
|
}
|
|
305
314
|
async stop() {
|
|
306
|
-
this.isStarted && (this.absolutePositionProviderId !== null && (
|
|
315
|
+
this.isStarted && (this.absolutePositionProviderId !== null && (t.removeEventListener(this.absolutePositionProviderId), this.absolutePositionProviderId = null), this.absoluteAttitudeProviderId !== null && (e.removeEventListener(this.absoluteAttitudeProviderId), this.absoluteAttitudeProviderId = null), this.isStarted = !1, this.setLocationState("no_positioning"));
|
|
316
|
+
}
|
|
317
|
+
async dispose() {
|
|
318
|
+
this.gnssWifiErrorListenerId !== null && (n.removeEventListener(this.gnssWifiErrorListenerId), this.gnssWifiErrorListenerId = null), await super.dispose();
|
|
307
319
|
}
|
|
308
|
-
},
|
|
320
|
+
}, v = class {
|
|
309
321
|
static itinerary = null;
|
|
310
322
|
static setItinerary(e) {
|
|
311
|
-
this.itinerary = e,
|
|
323
|
+
this.itinerary = e, r.itinerary = e;
|
|
312
324
|
}
|
|
313
325
|
static getItinerary() {
|
|
314
326
|
return this.itinerary ?? null;
|
|
315
327
|
}
|
|
316
328
|
static clearItinerary() {
|
|
317
|
-
this.itinerary = null,
|
|
329
|
+
this.itinerary = null, r.itinerary = null;
|
|
318
330
|
}
|
|
319
331
|
};
|
|
320
|
-
|
|
332
|
+
//#endregion
|
|
333
|
+
//#region src/utils/permissions.ts
|
|
334
|
+
async function y() {
|
|
321
335
|
if (typeof DeviceMotionEvent < "u" && "requestPermission" in DeviceMotionEvent && typeof DeviceMotionEvent.requestPermission == "function") try {
|
|
322
336
|
if (await DeviceMotionEvent.requestPermission() !== "granted") return !1;
|
|
323
337
|
} catch {
|
|
@@ -325,13 +339,14 @@ async function requestSensorPermissions() {
|
|
|
325
339
|
}
|
|
326
340
|
return !0;
|
|
327
341
|
}
|
|
328
|
-
async function
|
|
342
|
+
async function b() {
|
|
329
343
|
return new Promise((e) => {
|
|
330
|
-
|
|
344
|
+
n.addEventListener(() => {
|
|
331
345
|
e(!0);
|
|
332
346
|
}, () => {
|
|
333
347
|
e(!1);
|
|
334
348
|
});
|
|
335
349
|
});
|
|
336
350
|
}
|
|
337
|
-
|
|
351
|
+
//#endregion
|
|
352
|
+
export { l as Coordinates, _ as GnssWifiLocationSource, d as LocationSource, v as MapMatching, u as UserPosition, g as VPSLocationSource, b as requestLocationPermissions, y as requestSensorPermissions };
|
|
@@ -41,6 +41,18 @@ export interface ILocationSource {
|
|
|
41
41
|
* ```
|
|
42
42
|
*/
|
|
43
43
|
stop(): Promise<void>;
|
|
44
|
+
/**
|
|
45
|
+
* Permanently tear down the location source and release all resources.
|
|
46
|
+
*
|
|
47
|
+
* Stops the source and clears every registered callback. After `dispose()`
|
|
48
|
+
* the instance should be discarded and not restarted.
|
|
49
|
+
*
|
|
50
|
+
* @example
|
|
51
|
+
* ```typescript
|
|
52
|
+
* await locationSource.dispose?.();
|
|
53
|
+
* ```
|
|
54
|
+
*/
|
|
55
|
+
dispose?(): Promise<void>;
|
|
44
56
|
/**
|
|
45
57
|
* Register a callback to receive pose updates
|
|
46
58
|
*
|
|
@@ -53,7 +65,7 @@ export interface ILocationSource {
|
|
|
53
65
|
* ```typescript
|
|
54
66
|
* locationSource.onUpdate((pose) => {
|
|
55
67
|
* if (pose.position) {
|
|
56
|
-
* console.log(`Lat: ${pose.position.lat},
|
|
68
|
+
* console.log(`Lat: ${pose.position.lat}, Lng: ${pose.position.lng}`);
|
|
57
69
|
* }
|
|
58
70
|
* });
|
|
59
71
|
* ```
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ILocationSource.d.ts","sourceRoot":"","sources":["../../src/ILocationSource.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAE3C;;;;;;;;;;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,QAAQ,EAAE,CAAC,IAAI,EAAE,WAAW,KAAK,IAAI,GAAG,IAAI,CAAC;IAExD;;;;;;;;;;;OAWG;IACH,OAAO,CAAC,CAAC,QAAQ,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,GAAG,IAAI,CAAC;IAEjD;;;;;;;;;;;;OAYG;IACH,QAAQ,CAAC,CAAC,QAAQ,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,GAAG,IAAI,CAAC;CACnD"}
|
|
@@ -18,8 +18,8 @@ import { Itinerary } from '@wemap/routers';
|
|
|
18
18
|
* // Create a router instance and calculate a route
|
|
19
19
|
* const router = new Router();
|
|
20
20
|
* const itineraries = await router.directions(
|
|
21
|
-
* { lat: 48.8566,
|
|
22
|
-
* { lat: 48.8606,
|
|
21
|
+
* { lat: 48.8566, lng: 2.3522 },
|
|
22
|
+
* { lat: 48.8606, lng: 2.3376 },
|
|
23
23
|
* 'WALK'
|
|
24
24
|
* );
|
|
25
25
|
*
|
|
@@ -46,6 +46,7 @@ export interface GnssWifiLocationSourceConfig extends LocationSourceOptions {
|
|
|
46
46
|
export declare class GnssWifiLocationSource extends LocationSource {
|
|
47
47
|
private absolutePositionProviderId;
|
|
48
48
|
private absoluteAttitudeProviderId;
|
|
49
|
+
private gnssWifiErrorListenerId;
|
|
49
50
|
private positionSmoother?;
|
|
50
51
|
private config;
|
|
51
52
|
constructor(config?: GnssWifiLocationSourceConfig);
|
|
@@ -75,5 +76,6 @@ export declare class GnssWifiLocationSource extends LocationSource {
|
|
|
75
76
|
*/
|
|
76
77
|
stopAttitude(): Promise<void>;
|
|
77
78
|
stop(): Promise<void>;
|
|
79
|
+
dispose(): Promise<void>;
|
|
78
80
|
}
|
|
79
81
|
//# sourceMappingURL=GnssWifiLocationSource.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GnssWifiLocationSource.d.ts","sourceRoot":"","sources":["../../../src/location-sources/GnssWifiLocationSource.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,UAAU,CAAC;AACtD,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAElD;;GAEG;AACH,MAAM,WAAW,4BAA6B,SAAQ,qBAAqB;IACzE,uCAAuC;IACvC,iBAAiB;IACjB,QAAQ,CAAC,EAAE;QACT,sDAAsD;QACtD,qBAAqB,CAAC,EAAE,MAAM,CAAC;QAC/B,uDAAuD;QACvD,kBAAkB,CAAC,EAAE,OAAO,CAAC;KAC9B,CAAC;IACF,6DAA6D;IAC7D,cAAc,CAAC,EAAE,OAAO,CAAC;CAC1B;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,qBAAa,sBAAuB,SAAQ,cAAc;IACxD,OAAO,CAAC,0BAA0B,CAAuB;IACzD,OAAO,CAAC,0BAA0B,CAAuB;IACzD,OAAO,CAAC,gBAAgB,CAAC,CAAmB;IAC5C,OAAO,CAAC,MAAM,CAA+B;gBAEjC,MAAM,GAAE,4BAAiC;IA8BrD,OAAO,CAAC,iBAAiB;IAenB,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;IAiD5B;;;;;;;;;;OAUG;IACG,aAAa,IAAI,OAAO,CAAC,IAAI,CAAC;IAmBpC;;;;;;;;;OASG;IACG,YAAY,IAAI,OAAO,CAAC,IAAI,CAAC;IAO7B,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;
|
|
1
|
+
{"version":3,"file":"GnssWifiLocationSource.d.ts","sourceRoot":"","sources":["../../../src/location-sources/GnssWifiLocationSource.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,UAAU,CAAC;AACtD,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAElD;;GAEG;AACH,MAAM,WAAW,4BAA6B,SAAQ,qBAAqB;IACzE,uCAAuC;IACvC,iBAAiB;IACjB,QAAQ,CAAC,EAAE;QACT,sDAAsD;QACtD,qBAAqB,CAAC,EAAE,MAAM,CAAC;QAC/B,uDAAuD;QACvD,kBAAkB,CAAC,EAAE,OAAO,CAAC;KAC9B,CAAC;IACF,6DAA6D;IAC7D,cAAc,CAAC,EAAE,OAAO,CAAC;CAC1B;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,qBAAa,sBAAuB,SAAQ,cAAc;IACxD,OAAO,CAAC,0BAA0B,CAAuB;IACzD,OAAO,CAAC,0BAA0B,CAAuB;IACzD,OAAO,CAAC,uBAAuB,CAAuB;IACtD,OAAO,CAAC,gBAAgB,CAAC,CAAmB;IAC5C,OAAO,CAAC,MAAM,CAA+B;gBAEjC,MAAM,GAAE,4BAAiC;IA8BrD,OAAO,CAAC,iBAAiB;IAenB,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;IAiD5B;;;;;;;;;;OAUG;IACG,aAAa,IAAI,OAAO,CAAC,IAAI,CAAC;IAmBpC;;;;;;;;;OASG;IACG,YAAY,IAAI,OAAO,CAAC,IAAI,CAAC;IAO7B,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;IAmBrB,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC;CAS/B"}
|
|
@@ -42,6 +42,21 @@ export declare abstract class LocationSource implements ILocationSource {
|
|
|
42
42
|
* Stop the location source and stop emitting updates
|
|
43
43
|
*/
|
|
44
44
|
abstract stop(): Promise<void>;
|
|
45
|
+
/**
|
|
46
|
+
* Permanently tear down the location source.
|
|
47
|
+
*
|
|
48
|
+
* Stops the source (via {@link stop}) and clears every registered callback
|
|
49
|
+
* (update, error and location-state). Subclasses override this to release
|
|
50
|
+
* their own provider-level listeners, then call `super.dispose()`.
|
|
51
|
+
*
|
|
52
|
+
* After `dispose()` the instance should be discarded and not restarted.
|
|
53
|
+
*
|
|
54
|
+
* @example
|
|
55
|
+
* ```typescript
|
|
56
|
+
* await locationSource.dispose();
|
|
57
|
+
* ```
|
|
58
|
+
*/
|
|
59
|
+
dispose(): Promise<void>;
|
|
45
60
|
/**
|
|
46
61
|
* Register a callback to receive pose updates
|
|
47
62
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LocationSource.d.ts","sourceRoot":"","sources":["../../../src/location-sources/LocationSource.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAE1D,OAAO,KAAK,EAAE,WAAW,EAAE,IAAI,EAAE,kBAAkB,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAErF;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,8BAAsB,cAAe,YAAW,eAAe;IAC7D,SAAS,CAAC,WAAW,EAAE,IAAI,CAAM;IACjC,SAAS,CAAC,eAAe,aAAkB,WAAW,KAAK,IAAI,EAAI;IACnE,SAAS,CAAC,cAAc,cAAmB,KAAK,KAAK,IAAI,EAAI;IACtD,SAAS,UAAS;IAEzB,OAAO,CAAC,cAAc,CAAmC;IACzD,OAAO,CAAC,sBAAsB,CAA8C;IAE5E;;OAEG;IACH,QAAQ,CAAC,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;IAE/B;;OAEG;IACH,QAAQ,CAAC,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;IAE9B;;;;;;;;;;;;;;OAcG;IACH,QAAQ,CAAC,QAAQ,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,IAAI,GAAG,IAAI;IAa9C;;;;OAIG;IACH,SAAS,CAAC,QAAQ,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,IAAI,GAAG,IAAI;IAI/C;;;;OAIG;IACH,OAAO,CAAC,QAAQ,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,GAAG,IAAI;IAI/C;;;;OAIG;IACH,QAAQ,CAAC,QAAQ,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,GAAG,IAAI;IAIhD;;;;OAIG;IACH,SAAS,CAAC,oBAAoB,CAAC,OAAO,CAAC,EAAE,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AC,EAAE,kBAAkB,GAAG,IAAI;IAsBlE;;;;OAIG;IACH,SAAS,CAAC,kBAAkB,CAAC,WAAW,EAAE,WAAW,GAAG,IAAI;IAsB5D;;;;OAIG;IACH,SAAS,CAAC,UAAU,CAAC,IAAI,EAAE,WAAW,GAAG,IAAI;IAU7C;;;;OAIG;IACH,SAAS,CAAC,SAAS,CAAC,KAAK,EAAE,KAAK,GAAG,IAAI;IAUvC;;;;OAIG;IACH,IAAI,aAAa,IAAI,aAAa,CAEjC;IAEM,qBAAqB,CAAC,QAAQ,EAAE,CAAC,MAAM,EAAE,aAAa,KAAK,IAAI,GAAG,IAAI;IAItE,sBAAsB,CAAC,QAAQ,EAAE,CAAC,MAAM,EAAE,aAAa,KAAK,IAAI,GAAG,IAAI;IAI9E,SAAS,CAAC,gBAAgB,CAAC,aAAa,EAAE,aAAa,GAAG,IAAI;CAS/D"}
|
|
@@ -51,6 +51,7 @@ export declare class VPSLocationSource extends LocationSource {
|
|
|
51
51
|
private scanStatusCallbacks;
|
|
52
52
|
private backgroundScanStatusCallbacks;
|
|
53
53
|
private backgroundScanner;
|
|
54
|
+
private backgroundScanStatusUnsubscribe;
|
|
54
55
|
private lastBackgroundCandidatePosition;
|
|
55
56
|
private readonly ACCURACY_BACKGROUND_SCAN_THRESHOLD;
|
|
56
57
|
private degradedLocationStateThreshold;
|
|
@@ -85,6 +86,7 @@ export declare class VPSLocationSource extends LocationSource {
|
|
|
85
86
|
private configureVpsProvider;
|
|
86
87
|
start(): Promise<void>;
|
|
87
88
|
stop(): Promise<void>;
|
|
89
|
+
dispose(): Promise<void>;
|
|
88
90
|
/**
|
|
89
91
|
* Start the VPS scan
|
|
90
92
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"VPSLocationSource.d.ts","sourceRoot":"","sources":["../../../src/location-sources/VPSLocationSource.ts"],"names":[],"mappings":"AAAA,OAAO,EAUL,KAAK,uBAAuB,EAC7B,MAAM,kBAAkB,CAAC;AAE1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MAAM,EAAE,UAAU,KAAK,IAAI,GAAG,IAAI;IAIxE;;OAEG;IACI,4BAA4B,CAAC,QAAQ,EAAE,CAAC,MAAM,EAAE,oBAAoB,KAAK,IAAI,GAAG,MAAM,IAAI;IAOjG;;OAEG;IACI,6BAA6B,CAAC,QAAQ,EAAE,CAAC,MAAM,EAAE,oBAAoB,KAAK,IAAI,GAAG,IAAI;IAI5F,OAAO,CAAC,aAAa;IAcrB,OAAO,CAAC,uBAAuB;IAc/B,OAAO,CAAC,oBAAoB;IA0CtB,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;IAetB,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;IA8BrB,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC;IAY9B;;;;;;;;;;;;;;;;;;;;;;;;;;OA0BG;IACG,SAAS,IAAI,OAAO,CAAC,OAAO,CAAC;YAKrB,iBAAiB;IA+C/B;;;;;;;;;OASG;IACH;;OAEG;IACG,QAAQ,CAAC,SAAS,UAAQ,GAAG,OAAO,CAAC,IAAI,CAAC;YAgBlC,cAAc;IAwC5B,OAAO,CAAC,sBAAsB;IAc9B,OAAO,CAAC,cAAc;IA2BtB,OAAO,CAAC,0BAA0B;IAQlC;;;;OAIG;IACH,OAAO,CAAC,wBAAwB;IAuDhC,OAAO,CAAC,mBAAmB;IAO3B,OAAO,CAAC,8BAA8B;CA2BvC"}
|
package/dist/src/types.d.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { AbsolutePosition, AbsoluteAttitude } from '@wemap/providers';
|
|
2
1
|
import { UserPosition, Attitude } from '@wemap/geo';
|
|
3
2
|
/**
|
|
4
3
|
* Complete pose data combining position, attitude, and other sensor data
|
|
@@ -16,10 +15,15 @@ import { UserPosition, Attitude } from '@wemap/geo';
|
|
|
16
15
|
* ```
|
|
17
16
|
*/
|
|
18
17
|
export interface Pose {
|
|
19
|
-
/**
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
18
|
+
/**
|
|
19
|
+
* User position. A {@link UserPosition} (a `Coordinates` with `time`,
|
|
20
|
+
* `accuracy` and `bearing`), so it always exposes `lat`/`lng` (and the
|
|
21
|
+
* `latitude`/`longitude` aliases), `alt` and `level`. May be `undefined`
|
|
22
|
+
* before the first fix.
|
|
23
|
+
*/
|
|
24
|
+
position?: UserPosition;
|
|
25
|
+
/** Attitude/orientation data (heading, pitch, roll). See {@link Attitude}. */
|
|
26
|
+
attitude?: Attitude;
|
|
23
27
|
/** Inclination angle in radians */
|
|
24
28
|
inclination?: number;
|
|
25
29
|
/** Timestamp of the pose update (milliseconds since epoch) */
|
|
@@ -38,7 +42,7 @@ export interface Pose {
|
|
|
38
42
|
* ```typescript
|
|
39
43
|
* // Provider might emit only position update
|
|
40
44
|
* const partialUpdate: PartialPose = {
|
|
41
|
-
* position:
|
|
45
|
+
* position: new Coordinates(48.8566, 2.3522),
|
|
42
46
|
* time: Date.now()
|
|
43
47
|
* };
|
|
44
48
|
* ```
|
|
@@ -52,8 +56,6 @@ export interface MapMatchingOptions {
|
|
|
52
56
|
maxAngleBearing?: number;
|
|
53
57
|
/** Maximum distance in meters from route to consider a match */
|
|
54
58
|
maxDistance?: number;
|
|
55
|
-
/** Minimum distance in meters from route to consider a match */
|
|
56
|
-
minDistance?: number;
|
|
57
59
|
/** Whether to use orientation matching (defaults to true) */
|
|
58
60
|
useOrientationMatching?: boolean;
|
|
59
61
|
/** Whether to use strict map matching (defaults to false) */
|
package/dist/src/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAEzD;;;;;;;;;;;;;;GAcG;AACH,MAAM,WAAW,IAAI;IACnB;;;;;OAKG;IACH,QAAQ,CAAC,EAAE,YAAY,CAAC;IACxB,8EAA8E;IAC9E,QAAQ,CAAC,EAAE,QAAQ,CAAC;IACpB,mCAAmC;IACnC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,8DAA8D;IAC9D,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,qDAAqD;IACrD,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED;;;;;;;;;;;;;;;GAeG;AACH,MAAM,MAAM,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;AAExC;;GAEG;AACH,MAAM,WAAW,kBAAkB;IACjC,8EAA8E;IAC9E,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,gEAAgE;IAChE,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,6DAA6D;IAC7D,sBAAsB,CAAC,EAAE,OAAO,CAAC;IACjC,6DAA6D;IAC7D,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB;AAED;;GAEG;AACH,MAAM,WAAW,qBAAsB,SAAQ,kBAAkB;IAC/D,2DAA2D;IAC3D,mBAAmB,CAAC,EAAE,OAAO,CAAC;CAC/B;AAED;;;;GAIG;AACH,MAAM,MAAM,aAAa,GAAG,UAAU,GAAG,UAAU,GAAG,gBAAgB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wemap/positioning",
|
|
3
|
-
"version": "14.6.0
|
|
3
|
+
"version": "14.6.0",
|
|
4
4
|
"description": "Indoor/outdoor positioning for the Wemap SDK.",
|
|
5
5
|
"license": "UNLICENSED",
|
|
6
6
|
"author": "Wemap SAS",
|
|
@@ -37,10 +37,10 @@
|
|
|
37
37
|
"dist"
|
|
38
38
|
],
|
|
39
39
|
"dependencies": {
|
|
40
|
-
"@wemap/core": "14.6.0
|
|
41
|
-
"@wemap/geo": "14.6.0
|
|
42
|
-
"@wemap/providers": "14.6.0
|
|
43
|
-
"@wemap/routers": "14.6.0
|
|
44
|
-
"@wemap/utils": "14.6.0
|
|
40
|
+
"@wemap/core": "14.6.0",
|
|
41
|
+
"@wemap/geo": "14.6.0",
|
|
42
|
+
"@wemap/providers": "14.6.0",
|
|
43
|
+
"@wemap/routers": "14.6.0",
|
|
44
|
+
"@wemap/utils": "14.6.0"
|
|
45
45
|
}
|
|
46
46
|
}
|
package/dist/vitest.config.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"vitest.config.d.ts","sourceRoot":"","sources":["../vitest.config.ts"],"names":[],"mappings":";AAMA,wBAkBG"}
|