@wemap/positioning 14.6.0-beta.4 → 14.6.0-beta.5

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 CHANGED
@@ -1,7 +1,8 @@
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
- var LocationSource = class {
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();
@@ -25,24 +26,24 @@ var LocationSource = class {
25
26
  this.errorCallbacks.delete(e);
26
27
  }
27
28
  configureMapMatching(e) {
28
- e?.minDistance !== void 0 && (MapMatchingHandler.minDistance = e.minDistance), e?.maxDistance !== void 0 && (MapMatchingHandler.maxDistance = e.maxDistance), e?.maxAngleBearing !== void 0 && (MapMatchingHandler.maxAngleBearing = e.maxAngleBearing), e?.minDistance === void 0 && e?.maxDistance === void 0 && (MapMatchingHandler.minDistance = 5, MapMatchingHandler.maxDistance = 30), e?.useOrientationMatching !== void 0 && (MapMatchingHandler.useOrientationMatching = e.useOrientationMatching), e?.useStrict !== void 0 && (MapMatchingHandler.useStrict = e.useStrict);
29
+ e?.minDistance !== void 0 && (r.minDistance = e.minDistance), e?.maxDistance !== void 0 && (r.maxDistance = e.maxDistance), e?.maxAngleBearing !== void 0 && (r.maxAngleBearing = e.maxAngleBearing), e?.minDistance === void 0 && e?.maxDistance === void 0 && (r.minDistance = 5, r.maxDistance = 30), e?.useOrientationMatching !== void 0 && (r.useOrientationMatching = e.useOrientationMatching), e?.useStrict !== void 0 && (r.useStrict = e.useStrict);
29
30
  }
30
31
  mergeAndEmitUpdate(e) {
31
32
  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
33
  }
33
34
  emitUpdate(e) {
34
- this.updateCallbacks.forEach((h) => {
35
+ this.updateCallbacks.forEach((t) => {
35
36
  try {
36
- h(e);
37
+ t(e);
37
38
  } catch (e) {
38
39
  console.error(`Error in ${this.constructor.name} callback:`, e);
39
40
  }
40
41
  });
41
42
  }
42
43
  emitError(e) {
43
- this.errorCallbacks.forEach((h) => {
44
+ this.errorCallbacks.forEach((t) => {
44
45
  try {
45
- h(e);
46
+ t(e);
46
47
  } catch (e) {
47
48
  console.error(`Error in ${this.constructor.name} error callback:`, e);
48
49
  }
@@ -58,11 +59,11 @@ var LocationSource = class {
58
59
  this.locationStateCallbacks.delete(e);
59
60
  }
60
61
  setLocationState(e) {
61
- this._locationState !== e && (this._locationState = e, this.locationStateCallbacks.forEach((h) => {
62
- h(e);
62
+ this._locationState !== e && (this._locationState = e, this.locationStateCallbacks.forEach((t) => {
63
+ t(e);
63
64
  }));
64
65
  }
65
- }, DEFAULT_BACKGROUND_SCAN_INTERVAL_MS = 3e4, DEFAULT_BACKGROUND_SCAN_ENABLED = !0, DEFAULT_DEGRADED_LOCATION_STATE_THRESHOLD = 50, DEFAULT_NO_POSITIONING_LOCATION_STATE_THRESHOLD = 100, VPSLocationSource = class extends LocationSource {
66
+ }, f = 3e4, p = !0, m = 50, h = 100, g = class extends d {
66
67
  absolutePositionProviderId = null;
67
68
  absoluteAttitudeProviderId = null;
68
69
  vpsProviderListenerId = null;
@@ -84,17 +85,17 @@ var LocationSource = class {
84
85
  degradedLocationStateThreshold;
85
86
  noPositioningLocationStateThreshold;
86
87
  constructor(e = {}) {
87
- super(), this.backgroundScanEnabled = e.vps?.backgroundScan ?? DEFAULT_BACKGROUND_SCAN_ENABLED, this.degradedLocationStateThreshold = e.vps?.degradedLocationStateThreshold ?? DEFAULT_DEGRADED_LOCATION_STATE_THRESHOLD, this.noPositioningLocationStateThreshold = e.vps?.noPositioningLocationStateThreshold ?? DEFAULT_NO_POSITIONING_LOCATION_STATE_THRESHOLD, this.configureVpsProvider(e.vps), this.configureMapMatching(e), e.usePositionSmoother !== !1 && (this.positionSmoother = new PositionSmoother((e) => {
88
+ 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
89
  this.mergeAndEmitUpdate({
89
90
  position: e,
90
91
  time: "time" in e ? e.time : Date.now(),
91
92
  accuracy: "accuracy" in e ? e.accuracy : void 0
92
93
  });
93
- })), ProvidersOptions.ignoreProviders = ["GnssWifi"];
94
- let h = e.vps?.backgroundScanIntervalMs ?? DEFAULT_BACKGROUND_SCAN_INTERVAL_MS;
95
- this.backgroundScanner = new VpsBackgroundScanner({
94
+ })), a.ignoreProviders = ["GnssWifi"];
95
+ let t = e.vps?.backgroundScanIntervalMs ?? f;
96
+ this.backgroundScanner = new o({
96
97
  enabled: this.backgroundScanEnabled,
97
- intervalMs: h
98
+ intervalMs: t
98
99
  }, (e) => this.handleBackgroundVpsEvent(e), (e) => {
99
100
  this.emitError(e);
100
101
  }), this._backgroundScanStatus = this.backgroundScanEnabled ? "idle" : "disabled", this.backgroundScanner && this.backgroundScanner.onStatusChange((e) => {
@@ -124,67 +125,67 @@ var LocationSource = class {
124
125
  this.backgroundScanStatusCallbacks.delete(e);
125
126
  }
126
127
  setScanStatus(e) {
127
- this._scanStatus !== e && (this._scanStatus = e, this.scanStatusCallbacks.forEach((h) => {
128
+ this._scanStatus !== e && (this._scanStatus = e, this.scanStatusCallbacks.forEach((t) => {
128
129
  try {
129
- h(e);
130
+ t(e);
130
131
  } catch (e) {
131
132
  console.error("[VPSLocationSource] Error in scanStatus listener", e);
132
133
  }
133
134
  }));
134
135
  }
135
136
  setBackgroundScanStatus(e) {
136
- this._backgroundScanStatus !== e && (this._backgroundScanStatus = e, this.backgroundScanStatusCallbacks.forEach((h) => {
137
+ this._backgroundScanStatus !== e && (this._backgroundScanStatus = e, this.backgroundScanStatusCallbacks.forEach((t) => {
137
138
  try {
138
- h(e);
139
+ t(e);
139
140
  } catch (e) {
140
141
  console.error("[VPSLocationSource] Error in backgroundScanStatus listener", e);
141
142
  }
142
143
  }));
143
144
  }
144
145
  configureVpsProvider(e) {
145
- let h = CoreConfig.getConfig()?.arNavigationData?.providers?.vps, g = e?.endpoint ?? h?.endpoint;
146
- if (!g) throw Error("VPSLocationSource requires an endpoint URL. Provide it in config or ensure CoreConfig is initialized with arNavigationData.providers.vps.endpoint");
147
- let _ = new URL(g);
148
- _.href += "geopose", VpsProvider.endpoint = _.toString();
149
- let v = e?.minInclinationForRequest ?? (h?.minInclinationForRequest ? h.minInclinationForRequest * Math.PI / 180 : void 0);
150
- v !== void 0 && (VpsProvider.minInclinationForRequest = v);
151
- let y = e?.waitTimeMinInclinationForRequest ?? h?.waitTimeMinInclinationForRequest;
152
- y !== void 0 && (VpsProvider.waitTimeMinInclinationForRequest = y);
153
- let b = e?.useCoarsePose ?? h?.useCoarsePose;
154
- b !== void 0 && (VpsProvider.useCoarsePose = b), e?.requestCaller !== void 0 && (VpsProvider.requestCaller = e.requestCaller);
146
+ let t = c.getConfig()?.arNavigationData?.providers?.vps, n = e?.endpoint ?? t?.endpoint;
147
+ if (!n) throw Error("VPSLocationSource requires an endpoint URL. Provide it in config or ensure CoreConfig is initialized with arNavigationData.providers.vps.endpoint");
148
+ let r = new URL(n);
149
+ r.href += "geopose", s.endpoint = r.toString();
150
+ let i = e?.minInclinationForRequest ?? (t?.minInclinationForRequest ? t.minInclinationForRequest * Math.PI / 180 : void 0);
151
+ i !== void 0 && (s.minInclinationForRequest = i);
152
+ let a = e?.waitTimeMinInclinationForRequest ?? t?.waitTimeMinInclinationForRequest;
153
+ a !== void 0 && (s.waitTimeMinInclinationForRequest = a);
154
+ let o = e?.useCoarsePose ?? t?.useCoarsePose;
155
+ o !== void 0 && (s.useCoarsePose = o), e?.requestCaller !== void 0 && (s.requestCaller = e.requestCaller);
155
156
  }
156
157
  async start() {
157
158
  this.isStarted || (this.setupListeners(), this.isStarted = !0, this.backgroundScanEnabled ? this.backgroundScanner?.schedule() : this.setBackgroundScanStatus("disabled"));
158
159
  }
159
160
  async stop() {
160
- this.isStarted && (this.vpsProviderListenerId !== null && (VpsProvider.removeEventListener(this.vpsProviderListenerId), this.vpsProviderListenerId = null, VpsProvider.stop()), this.absolutePositionProviderId !== null && (AbsolutePositionProvider.removeEventListener(this.absolutePositionProviderId), this.absolutePositionProviderId = null), this.absoluteAttitudeProviderId !== null && (AbsoluteAttitudeProvider.removeEventListener(this.absoluteAttitudeProviderId), this.absoluteAttitudeProviderId = null), this.backgroundScanner?.clear(), this.setBackgroundScanStatus(this.backgroundScanEnabled ? "idle" : "disabled"), this.isStarted = !1, this.setLocationState("no_positioning"));
161
+ 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"));
161
162
  }
162
163
  async startScan() {
163
164
  return await this.backgroundScanner?.cancelRunningScan(), this.startScanInternal();
164
165
  }
165
166
  async startScanInternal() {
166
167
  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 VpsProvider.getAvailability();
168
+ let e = await s.getAvailability();
168
169
  if (e instanceof Error) throw e;
169
170
  return this.setScanStatus("scanning"), this.scanPromise = new Promise((e) => {
170
- this.scanResolve = e, this.vpsProviderListenerId = VpsProvider.addEventListener((h) => {
171
- this.scanResolve = null, this.stopScan(), this.handleVpsEvent(h), this.backgroundScanner?.schedule(), e(!0);
172
- }, (h) => {
173
- this.scanResolve = null, this.emitError(h), this.backgroundScanner?.schedule(), e(!1);
171
+ this.scanResolve = e, this.vpsProviderListenerId = s.addEventListener((t) => {
172
+ this.scanResolve = null, this.stopScan(), this.handleVpsEvent(t), this.backgroundScanner?.schedule(), e(!0);
173
+ }, (t) => {
174
+ this.scanResolve = null, this.emitError(t), this.backgroundScanner?.schedule(), e(!1);
174
175
  });
175
176
  }), this.scanPromise;
176
177
  }
177
178
  async stopScan(e = !1) {
178
- e && this.scanResolve && (this.scanResolve(!1), this.scanResolve = null), this.vpsProviderListenerId !== null && (VpsProvider.removeEventListener(this.vpsProviderListenerId), this.vpsProviderListenerId = null, VpsProvider.stop(), this.setScanStatus("stopped"));
179
+ 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
180
  }
180
181
  async setupListeners() {
181
- if (!this.absolutePositionProviderId && this.firstScan && (await AbsolutePositionProvider.getAvailability() instanceof Error || (this.absolutePositionProviderId = AbsolutePositionProvider.addEventListener((e) => {
182
+ if (!this.absolutePositionProviderId && this.firstScan && (await t.getAvailability() instanceof Error || (this.absolutePositionProviderId = t.addEventListener((e) => {
182
183
  this.scanStatus !== "scanning" && this.handleAbsolutePosition(e);
183
184
  }, (e) => {
184
185
  this.emitError(e);
185
186
  }))), !this.absoluteAttitudeProviderId && this.firstScan) {
186
- let h = await AbsoluteAttitudeProvider.getAvailability();
187
- h instanceof Error ? console.warn("AbsoluteAttitudeProvider not available:", h) : this.absoluteAttitudeProviderId = AbsoluteAttitudeProvider.addEventListener((e) => {
187
+ let t = await e.getAvailability();
188
+ t instanceof Error ? console.warn("AbsoluteAttitudeProvider not available:", t) : this.absoluteAttitudeProviderId = e.addEventListener((e) => {
188
189
  this.mergeAndEmitUpdate({
189
190
  attitude: e,
190
191
  time: "time" in e ? e.time : Date.now()
@@ -202,37 +203,37 @@ var LocationSource = class {
202
203
  });
203
204
  }
204
205
  handleVpsEvent(e) {
205
- let h = {};
206
+ let t = {};
206
207
  if (e.absolutePosition) {
207
- this.registerScanSuccess(e.absolutePosition), h.position = e.absolutePosition;
208
- let g = "time" in e.absolutePosition ? e.absolutePosition.time : Date.now(), _ = "accuracy" in e.absolutePosition ? e.absolutePosition.accuracy : void 0;
209
- h.time = g, _ !== void 0 && (h.accuracy = _);
208
+ this.registerScanSuccess(e.absolutePosition), t.position = e.absolutePosition;
209
+ let n = "time" in e.absolutePosition ? e.absolutePosition.time : Date.now(), r = "accuracy" in e.absolutePosition ? e.absolutePosition.accuracy : void 0;
210
+ t.time = n, r !== void 0 && (t.accuracy = r);
210
211
  }
211
- e.absoluteAttitude && (h.attitude = e.absoluteAttitude), this.mergeAndEmitUpdate(h);
212
+ e.absoluteAttitude && (t.attitude = e.absoluteAttitude), this.mergeAndEmitUpdate(t);
212
213
  }
213
214
  getCurrentAbsolutePosition() {
214
215
  let e = this.currentPose.position;
215
216
  return !e || !("latitude" in e) || !("longitude" in e) ? null : e;
216
217
  }
217
218
  handleBackgroundVpsEvent(e) {
218
- let h = e.absolutePosition;
219
- if (!h) {
219
+ let t = e.absolutePosition;
220
+ if (!t) {
220
221
  this.backgroundScanner?.schedule();
221
222
  return;
222
223
  }
223
- let g = this.getCurrentAbsolutePosition();
224
+ let n = this.getCurrentAbsolutePosition();
224
225
  if (!this.lastBackgroundCandidatePosition) {
225
- if (g && h.distanceTo(g) < this.ACCURACY_BACKGROUND_SCAN_THRESHOLD) {
226
+ if (n && t.distanceTo(n) < this.ACCURACY_BACKGROUND_SCAN_THRESHOLD) {
226
227
  this.handleVpsEvent(e), this.backgroundScanner?.schedule();
227
228
  return;
228
229
  }
229
- this.lastBackgroundCandidatePosition = h, this.backgroundScanner?.runNow();
230
+ this.lastBackgroundCandidatePosition = t, this.backgroundScanner?.runNow();
230
231
  return;
231
232
  }
232
- let _ = this.lastBackgroundCandidatePosition;
233
+ let r = this.lastBackgroundCandidatePosition;
233
234
  this.lastBackgroundCandidatePosition = null;
234
- let v = !1;
235
- g && h.distanceTo(g) < this.ACCURACY_BACKGROUND_SCAN_THRESHOLD && (v = !0), !v && _ && h.distanceTo(_) < this.ACCURACY_BACKGROUND_SCAN_THRESHOLD && (v = !0), v && this.handleVpsEvent(e), this.backgroundScanner?.schedule();
235
+ let i = !1;
236
+ 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
237
  }
237
238
  registerScanSuccess(e) {
238
239
  this.lastScanPosition = e, this.lastPosition = e, this.distanceSinceLastScan = 0, this.setLocationState("accurate");
@@ -243,34 +244,34 @@ var LocationSource = class {
243
244
  this.lastPosition = e;
244
245
  return;
245
246
  }
246
- let h = this.lastPosition.distanceTo(e);
247
- this.lastPosition = e, this.lastScanPosition && (this.distanceSinceLastScan += h, this.distanceSinceLastScan >= this.noPositioningLocationStateThreshold ? this.setLocationState("no_positioning") : this.distanceSinceLastScan >= this.degradedLocationStateThreshold ? this.setLocationState("degraded") : this.setLocationState("accurate"));
247
+ let t = this.lastPosition.distanceTo(e);
248
+ 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
249
  }
249
- }, GnssWifiLocationSource = class extends LocationSource {
250
+ }, _ = class extends d {
250
251
  absolutePositionProviderId = null;
251
252
  absoluteAttitudeProviderId = null;
252
253
  positionSmoother;
253
254
  config;
254
255
  constructor(e = {}) {
255
- super(), this.config = e, this.configureGnssWifi(e.gnssWifi), this.configureMapMatching(e), e.usePositionSmoother !== !1 && (this.positionSmoother = new PositionSmoother((e) => {
256
+ super(), this.config = e, this.configureGnssWifi(e.gnssWifi), this.configureMapMatching(e), e.usePositionSmoother !== !1 && (this.positionSmoother = new i((e) => {
256
257
  this.mergeAndEmitUpdate({
257
258
  position: e,
258
259
  time: "time" in e ? e.time : Date.now(),
259
260
  accuracy: "accuracy" in e ? e.accuracy : void 0
260
261
  });
261
- })), GnssWifiProvider.addEventListener(() => {}, (e) => {
262
+ })), n.addEventListener(() => {}, (e) => {
262
263
  this.emitError(e);
263
264
  }, !1);
264
265
  }
265
266
  configureGnssWifi(e) {
266
- let h = CoreConfig.getConfig()?.arNavigationData?.providers, _ = e ?? h?.gnssWifi;
267
- _ && (_.discardPositionsAbove !== void 0 && (GnssWifiProvider.discardPositionsAbove = _.discardPositionsAbove), _.enableHighAccuracy !== void 0 && (GnssWifiProvider.enableHighAccuracy = _.enableHighAccuracy));
267
+ let t = c.getConfig()?.arNavigationData?.providers, r = e ?? t?.gnssWifi;
268
+ r && (r.discardPositionsAbove !== void 0 && (n.discardPositionsAbove = r.discardPositionsAbove), r.enableHighAccuracy !== void 0 && (n.enableHighAccuracy = r.enableHighAccuracy));
268
269
  }
269
270
  async start() {
270
271
  if (!this.isStarted) try {
271
- let e = await AbsolutePositionProvider.getAvailability();
272
+ let e = await t.getAvailability();
272
273
  if (e instanceof Error) throw e;
273
- if (this.absolutePositionProviderId = AbsolutePositionProvider.addEventListener((e) => {
274
+ if (this.absolutePositionProviderId = t.addEventListener((e) => {
274
275
  this.setLocationState("accurate"), this.positionSmoother ? this.positionSmoother.feed(e) : this.mergeAndEmitUpdate({
275
276
  position: e,
276
277
  time: "time" in e ? e.time : Date.now(),
@@ -289,8 +290,8 @@ var LocationSource = class {
289
290
  }
290
291
  }
291
292
  async startAttitude() {
292
- let h = await AbsoluteAttitudeProvider.getAvailability();
293
- h instanceof Error ? console.warn("AbsoluteAttitudeProvider not available:", h) : this.absoluteAttitudeProviderId = AbsoluteAttitudeProvider.addEventListener((e) => {
293
+ let t = await e.getAvailability();
294
+ t instanceof Error ? console.warn("AbsoluteAttitudeProvider not available:", t) : this.absoluteAttitudeProviderId = e.addEventListener((e) => {
294
295
  this.mergeAndEmitUpdate({
295
296
  attitude: e,
296
297
  time: "time" in e ? e.time : Date.now()
@@ -300,24 +301,26 @@ var LocationSource = class {
300
301
  });
301
302
  }
302
303
  async stopAttitude() {
303
- this.absoluteAttitudeProviderId !== null && (AbsoluteAttitudeProvider.removeEventListener(this.absoluteAttitudeProviderId), this.absoluteAttitudeProviderId = null);
304
+ this.absoluteAttitudeProviderId !== null && (e.removeEventListener(this.absoluteAttitudeProviderId), this.absoluteAttitudeProviderId = null);
304
305
  }
305
306
  async stop() {
306
- this.isStarted && (this.absolutePositionProviderId !== null && (AbsolutePositionProvider.removeEventListener(this.absolutePositionProviderId), this.absolutePositionProviderId = null), this.absoluteAttitudeProviderId !== null && (AbsoluteAttitudeProvider.removeEventListener(this.absoluteAttitudeProviderId), this.absoluteAttitudeProviderId = null), this.isStarted = !1, this.setLocationState("no_positioning"));
307
+ 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"));
307
308
  }
308
- }, MapMatching = class {
309
+ }, v = class {
309
310
  static itinerary = null;
310
311
  static setItinerary(e) {
311
- this.itinerary = e, MapMatchingHandler.itinerary = e;
312
+ this.itinerary = e, r.itinerary = e;
312
313
  }
313
314
  static getItinerary() {
314
315
  return this.itinerary ?? null;
315
316
  }
316
317
  static clearItinerary() {
317
- this.itinerary = null, MapMatchingHandler.itinerary = null;
318
+ this.itinerary = null, r.itinerary = null;
318
319
  }
319
320
  };
320
- async function requestSensorPermissions() {
321
+ //#endregion
322
+ //#region src/utils/permissions.ts
323
+ async function y() {
321
324
  if (typeof DeviceMotionEvent < "u" && "requestPermission" in DeviceMotionEvent && typeof DeviceMotionEvent.requestPermission == "function") try {
322
325
  if (await DeviceMotionEvent.requestPermission() !== "granted") return !1;
323
326
  } catch {
@@ -325,13 +328,14 @@ async function requestSensorPermissions() {
325
328
  }
326
329
  return !0;
327
330
  }
328
- async function requestLocationPermissions() {
331
+ async function b() {
329
332
  return new Promise((e) => {
330
- GnssWifiProvider.addEventListener(() => {
333
+ n.addEventListener(() => {
331
334
  e(!0);
332
335
  }, () => {
333
336
  e(!1);
334
337
  });
335
338
  });
336
339
  }
337
- export { Coordinates, GnssWifiLocationSource, LocationSource, MapMatching, UserPosition, VPSLocationSource, requestLocationPermissions, requestSensorPermissions };
340
+ //#endregion
341
+ export { l as Coordinates, _ as GnssWifiLocationSource, d as LocationSource, v as MapMatching, u as UserPosition, g as VPSLocationSource, b as requestLocationPermissions, y as requestSensorPermissions };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wemap/positioning",
3
- "version": "14.6.0-beta.4",
3
+ "version": "14.6.0-beta.5",
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-beta.4",
41
- "@wemap/geo": "14.6.0-beta.4",
42
- "@wemap/providers": "14.6.0-beta.4",
43
- "@wemap/routers": "14.6.0-beta.4",
44
- "@wemap/utils": "14.6.0-beta.4"
40
+ "@wemap/core": "14.6.0-beta.5",
41
+ "@wemap/geo": "14.6.0-beta.5",
42
+ "@wemap/providers": "14.6.0-beta.5",
43
+ "@wemap/routers": "14.6.0-beta.5",
44
+ "@wemap/utils": "14.6.0-beta.5"
45
45
  }
46
46
  }
@@ -1,3 +0,0 @@
1
- declare const _default: import('vite').UserConfig;
2
- export default _default;
3
- //# sourceMappingURL=vitest.config.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"vitest.config.d.ts","sourceRoot":"","sources":["../vitest.config.ts"],"names":[],"mappings":";AAMA,wBAkBG"}