@mappedin/blue-dot 6.17.1-beta.0 → 6.19.0-beta.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.
@@ -1217,6 +1217,15 @@ type FollowCameraOptions = {
1217
1217
  easing?: 'ease-in' | 'ease-out' | 'ease-in-out' | 'linear';
1218
1218
  };
1219
1219
  type BlueDotEventPayloads = {
1220
+ /**
1221
+ * Emitted on every animation frame while the Blue Dot model is moving.
1222
+ * Unlike `position-update` (which fires only on raw sensor input, typically ~1Hz),
1223
+ * this fires at the display refresh rate during tweened movement, making it
1224
+ * suitable for smooth path-tracking visualizations.
1225
+ */
1226
+ 'dot-position-update': {
1227
+ position: Coordinate;
1228
+ };
1220
1229
  /**
1221
1230
  * Emitted when the Blue Dot's position is updated either from the device's geolocation API or by calling {@link BlueDot.update}.
1222
1231
  * see {@link BlueDot.watchDevicePosition} for more details.
@@ -1291,6 +1300,12 @@ type BlueDotEventPayloads = {
1291
1300
  };
1292
1301
  type BlueDotEvents = keyof BlueDotEventPayloads;
1293
1302
  type BlueDotState = {
1303
+ /**
1304
+ * Whether the BlueDot core element is visible. When false, the dot is hidden but the accuracy ring
1305
+ * and heading cone may still render based on their own visibility settings.
1306
+ * @default true
1307
+ */
1308
+ visible: boolean;
1294
1309
  /**
1295
1310
  * The radius of the BlueDot in pixels. The BlueDot will maintain this size clamped to a minimum of 0.35 metres.
1296
1311
  * @default 10
@@ -1310,6 +1325,11 @@ type BlueDotState = {
1310
1325
  * Options for the accuracy ring around the BlueDot.
1311
1326
  */
1312
1327
  accuracyRing: {
1328
+ /**
1329
+ * Whether the accuracy ring is visible.
1330
+ * @default true
1331
+ */
1332
+ visible: boolean;
1313
1333
  /**
1314
1334
  * The color of the accuracy ring.
1315
1335
  * @default #2266ff
@@ -1325,6 +1345,11 @@ type BlueDotState = {
1325
1345
  * Options for the heading directional indicator.
1326
1346
  */
1327
1347
  heading: {
1348
+ /**
1349
+ * Whether the heading cone is visible.
1350
+ * @default true
1351
+ */
1352
+ visible: boolean;
1328
1353
  /**
1329
1354
  * The color of the heading cone.
1330
1355
  * @default #2266ff
@@ -1461,12 +1486,6 @@ declare class PubSub<EVENT_PAYLOAD, EVENT extends keyof EVENT_PAYLOAD = keyof EV
1461
1486
  * AbortController for managing lifecycle and cleanup
1462
1487
  */
1463
1488
  private _abortController;
1464
- /**
1465
- * @protected
1466
- * @internal
1467
- * Tracks all cleanup functions for subscriptions made via on()
1468
- */
1469
- protected _cleanupFunctions: Array<() => void>;
1470
1489
  /**
1471
1490
  * Returns the AbortSignal for this PubSub instance.
1472
1491
  * Use this signal with APIs that support cancellation (fetch, addEventListener, etc.)
@@ -2022,6 +2041,8 @@ interface HeadingFilterConfig {
2022
2041
  magneticGatingEnabled: boolean;
2023
2042
  /** Minimum heading delta to emit updates (degrees). */
2024
2043
  deltaThreshold: number;
2044
+ /** Calibration offset applied to all compass readings (degrees). Set from VPS ground truth. */
2045
+ calibrationOffset: number;
2025
2046
  }
2026
2047
  /**
2027
2048
  * Complementary filter for heading fusion.
@@ -2074,6 +2095,13 @@ declare class HeadingFusionFilter implements HeadingFusionAlgorithm {
2074
2095
  * @param confidence GPS confidence (0-1), affects how much GPS heading influences result
2075
2096
  */
2076
2097
  correctWithGps(gpsHeading: number, speed: number, confidence?: number): void;
2098
+ /**
2099
+ * Set a calibration offset derived from a known ground-truth heading (e.g. VPS).
2100
+ * The offset is applied to all subsequent compass readings to correct systematic
2101
+ * magnetic bias at the calibration location.
2102
+ * @param offsetDegrees Offset in degrees (groundTruthHeading - deviceCompassHeading)
2103
+ */
2104
+ setCalibrationOffset(offsetDegrees: number): void;
2077
2105
  /**
2078
2106
  * Configure the filter parameters at runtime.
2079
2107
  * @param config Partial configuration to apply
package/lib/esm/index.js CHANGED
@@ -1 +1 @@
1
- import{a as t,b as e,c as s,d as n}from"./chunk-NUHGT3O3.js";import{m as o}from"./chunk-UZOPCEME.js";o();export{t as BaseSensor,n as BlueDot,e as ManualSensor,s as SensorRegistry};
1
+ import{a as t,b as e,c as s,d as n}from"./chunk-IJA5ETXF.js";import{j as o}from"./chunk-T4TSXXQK.js";o();export{t as BaseSensor,n as BlueDot,e as ManualSensor,s as SensorRegistry};
@@ -1217,6 +1217,15 @@ type FollowCameraOptions = {
1217
1217
  easing?: 'ease-in' | 'ease-out' | 'ease-in-out' | 'linear';
1218
1218
  };
1219
1219
  type BlueDotEventPayloads = {
1220
+ /**
1221
+ * Emitted on every animation frame while the Blue Dot model is moving.
1222
+ * Unlike `position-update` (which fires only on raw sensor input, typically ~1Hz),
1223
+ * this fires at the display refresh rate during tweened movement, making it
1224
+ * suitable for smooth path-tracking visualizations.
1225
+ */
1226
+ 'dot-position-update': {
1227
+ position: Coordinate;
1228
+ };
1220
1229
  /**
1221
1230
  * Emitted when the Blue Dot's position is updated either from the device's geolocation API or by calling {@link BlueDot.update}.
1222
1231
  * see {@link BlueDot.watchDevicePosition} for more details.
@@ -1291,6 +1300,12 @@ type BlueDotEventPayloads = {
1291
1300
  };
1292
1301
  type BlueDotEvents = keyof BlueDotEventPayloads;
1293
1302
  type BlueDotState = {
1303
+ /**
1304
+ * Whether the BlueDot core element is visible. When false, the dot is hidden but the accuracy ring
1305
+ * and heading cone may still render based on their own visibility settings.
1306
+ * @default true
1307
+ */
1308
+ visible: boolean;
1294
1309
  /**
1295
1310
  * The radius of the BlueDot in pixels. The BlueDot will maintain this size clamped to a minimum of 0.35 metres.
1296
1311
  * @default 10
@@ -1310,6 +1325,11 @@ type BlueDotState = {
1310
1325
  * Options for the accuracy ring around the BlueDot.
1311
1326
  */
1312
1327
  accuracyRing: {
1328
+ /**
1329
+ * Whether the accuracy ring is visible.
1330
+ * @default true
1331
+ */
1332
+ visible: boolean;
1313
1333
  /**
1314
1334
  * The color of the accuracy ring.
1315
1335
  * @default #2266ff
@@ -1325,6 +1345,11 @@ type BlueDotState = {
1325
1345
  * Options for the heading directional indicator.
1326
1346
  */
1327
1347
  heading: {
1348
+ /**
1349
+ * Whether the heading cone is visible.
1350
+ * @default true
1351
+ */
1352
+ visible: boolean;
1328
1353
  /**
1329
1354
  * The color of the heading cone.
1330
1355
  * @default #2266ff
@@ -1461,12 +1486,6 @@ declare class PubSub<EVENT_PAYLOAD, EVENT extends keyof EVENT_PAYLOAD = keyof EV
1461
1486
  * AbortController for managing lifecycle and cleanup
1462
1487
  */
1463
1488
  private _abortController;
1464
- /**
1465
- * @protected
1466
- * @internal
1467
- * Tracks all cleanup functions for subscriptions made via on()
1468
- */
1469
- protected _cleanupFunctions: Array<() => void>;
1470
1489
  /**
1471
1490
  * Returns the AbortSignal for this PubSub instance.
1472
1491
  * Use this signal with APIs that support cancellation (fetch, addEventListener, etc.)
@@ -2022,6 +2041,8 @@ interface HeadingFilterConfig {
2022
2041
  magneticGatingEnabled: boolean;
2023
2042
  /** Minimum heading delta to emit updates (degrees). */
2024
2043
  deltaThreshold: number;
2044
+ /** Calibration offset applied to all compass readings (degrees). Set from VPS ground truth. */
2045
+ calibrationOffset: number;
2025
2046
  }
2026
2047
  /**
2027
2048
  * Complementary filter for heading fusion.
@@ -2074,6 +2095,13 @@ declare class HeadingFusionFilter implements HeadingFusionAlgorithm {
2074
2095
  * @param confidence GPS confidence (0-1), affects how much GPS heading influences result
2075
2096
  */
2076
2097
  correctWithGps(gpsHeading: number, speed: number, confidence?: number): void;
2098
+ /**
2099
+ * Set a calibration offset derived from a known ground-truth heading (e.g. VPS).
2100
+ * The offset is applied to all subsequent compass readings to correct systematic
2101
+ * magnetic bias at the calibration location.
2102
+ * @param offsetDegrees Offset in degrees (groundTruthHeading - deviceCompassHeading)
2103
+ */
2104
+ setCalibrationOffset(offsetDegrees: number): void;
2077
2105
  /**
2078
2106
  * Configure the filter parameters at runtime.
2079
2107
  * @param config Partial configuration to apply
@@ -1 +1 @@
1
- import{d as f}from"../chunk-NUHGT3O3.js";import{c as n,m as u}from"../chunk-UZOPCEME.js";u();u();import{useCallback as c,useState as p}from"react";import{useMap as D,useMapViewExtension as m}from"@mappedin/react-sdk";function B(){let[,t]=p({});return c(()=>t({}),[])}n(B,"useForceUpdate");function l(){let{mapView:t}=D(),o=B(),{register:r}=m("blue-dot",{onRegister:n(()=>{let e=new f(t);return e.on("position-update",o),e.on("status-change",o),e.on("follow-change",o),e.on("error",o),e},"onRegister"),onDeregister:n(e=>{e.off("position-update",o),e.off("status-change",o),e.off("follow-change",o),e.off("error",o),e.destroy()},"onDeregister")}),s=r();if(!s)throw new Error("BlueDot failed to initialize.");return s}n(l,"useBlueDot");u();import{useCallback as d,useEffect as E,useRef as g}from"react";function w(t,o){let r=l(),s=g(o);s.current=o;let e=d(i=>{s.current(i)},[]);E(()=>{if(r!=null)return r.on(t,e),()=>{r!=null&&r.off(t,e)}},[r,t,e])}n(w,"useBlueDotEvent");export{l as useBlueDot,w as useBlueDotEvent};
1
+ import{d as f}from"../chunk-IJA5ETXF.js";import{a as n,j as u}from"../chunk-T4TSXXQK.js";u();u();import{useCallback as c,useState as p}from"react";import{useMap as D,useMapViewExtension as m}from"@mappedin/react-sdk";function B(){let[,t]=p({});return c(()=>t({}),[])}n(B,"useForceUpdate");function l(){let{mapView:t}=D(),o=B(),{register:r}=m("blue-dot",{onRegister:n(()=>{let e=new f(t);return e.on("position-update",o),e.on("status-change",o),e.on("follow-change",o),e.on("error",o),e},"onRegister"),onDeregister:n(e=>{e.off("position-update",o),e.off("status-change",o),e.off("follow-change",o),e.off("error",o),e.destroy()},"onDeregister")}),s=r();if(!s)throw new Error("BlueDot failed to initialize.");return s}n(l,"useBlueDot");u();import{useCallback as d,useEffect as E,useRef as g}from"react";function w(t,o){let r=l(),s=g(o);s.current=o;let e=d(i=>{s.current(i)},[]);E(()=>{if(r!=null)return r.on(t,e),()=>{r?.off(t,e)}},[r,t,e])}n(w,"useBlueDotEvent");export{l as useBlueDot,w as useBlueDotEvent};
@@ -13,6 +13,8 @@ export interface HeadingFilterConfig {
13
13
  magneticGatingEnabled: boolean;
14
14
  /** Minimum heading delta to emit updates (degrees). */
15
15
  deltaThreshold: number;
16
+ /** Calibration offset applied to all compass readings (degrees). Set from VPS ground truth. */
17
+ calibrationOffset: number;
16
18
  }
17
19
  /**
18
20
  * Complementary filter for heading fusion.
@@ -65,6 +67,13 @@ export declare class HeadingFusionFilter implements HeadingFusionAlgorithm {
65
67
  * @param confidence GPS confidence (0-1), affects how much GPS heading influences result
66
68
  */
67
69
  correctWithGps(gpsHeading: number, speed: number, confidence?: number): void;
70
+ /**
71
+ * Set a calibration offset derived from a known ground-truth heading (e.g. VPS).
72
+ * The offset is applied to all subsequent compass readings to correct systematic
73
+ * magnetic bias at the calibration location.
74
+ * @param offsetDegrees Offset in degrees (groundTruthHeading - deviceCompassHeading)
75
+ */
76
+ setCalibrationOffset(offsetDegrees: number): void;
68
77
  /**
69
78
  * Configure the filter parameters at runtime.
70
79
  * @param config Partial configuration to apply