@mappedin/react-native-sdk 5.34.2 → 5.35.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 CHANGED
@@ -1843,6 +1843,23 @@ declare module '@mappedin/react-native-sdk/sdks/packages/legacy-renderer/MapView
1843
1843
  export type { TOutdoorViewOptions, TOutdoorViewOptionsWithHeaders, TOutdoorViewOptionsWithAuthURL };
1844
1844
  export type { default as BlueDotController } from '@mappedin/react-native-sdk/sdks/packages/legacy-renderer/private/controllers/BlueDotController';
1845
1845
  export type { default as Journey } from '@mappedin/react-native-sdk/sdks/packages/legacy-renderer/public/api/Journey';
1846
+ export type TStackedMapsOptions = {
1847
+ /**
1848
+ * The vertical distance between maps in overview, in metres.
1849
+ * @default 50
1850
+ */
1851
+ verticalDistanceBetweenMaps?: number;
1852
+ /**
1853
+ * Whether to show map level labels in overview.
1854
+ * @default true
1855
+ */
1856
+ mapLabels?: boolean;
1857
+ /**
1858
+ * Whether to show only Journey maps in the stack if a Journey is active and the current map is part of the Journey.
1859
+ * @default true
1860
+ */
1861
+ prioritizeJourneyMaps?: boolean;
1862
+ };
1846
1863
  }
1847
1864
 
1848
1865
  declare module '@mappedin/react-native-sdk/sdks/packages/get-venue' {
@@ -4477,13 +4494,49 @@ declare module '@mappedin/react-native-sdk/sdks/packages/legacy-renderer/interna
4477
4494
  inactive?: string;
4478
4495
  };
4479
4496
  /**
4480
- * Size of bounding box of SVG icon
4497
+ * Size of bounding box of the icon
4498
+ * @default 10
4481
4499
  */
4482
4500
  iconSize?: number;
4483
4501
  /**
4484
- * SVG of icon to place inside Floating Label
4502
+ * Icon to be placed inside the Floating Label marker. Supports SVG or a URL to png or jpeg.
4503
+ * @example
4504
+ * ```ts
4505
+ * // SVG
4506
+ * mapView.FloatingLabels.add(polygon, "Label", {
4507
+ * appearance: {
4508
+ * marker: {
4509
+ * icon: `<svg>...</svg>`,
4510
+ * },
4511
+ * },
4512
+ * });
4513
+ * ```
4514
+ *
4515
+ * @example
4516
+ * ```ts
4517
+ * // Image URL
4518
+ * mapView.FloatingLabels.add(polygon, "Label", {
4519
+ * appearance: {
4520
+ * marker: {
4521
+ * icon: 'https://example.com/icon.png',
4522
+ * },
4523
+ * },
4524
+ * });
4525
+ * ```
4485
4526
  */
4486
4527
  icon?: string;
4528
+ /**
4529
+ * How the icon should fit inside the marker. By default, this is not set and the icon will be centered inside the marker.
4530
+ * - `fill` will stretch the icon to fill the marker.
4531
+ * - `cover` will maintain aspect ratio and fill the marker.
4532
+ * - `contain` will maintain aspect ratio and fit the icon inside the marker.
4533
+ */
4534
+ iconFit?: 'contain' | 'fill' | 'cover';
4535
+ /**
4536
+ * Padding around the icon, in pixels.
4537
+ * @default 4
4538
+ */
4539
+ iconPadding?: number;
4487
4540
  /**
4488
4541
  * Defines when the icon becomes visible relative to the current zoom level
4489
4542
  * anything below 0 will result in icons never showing up
@@ -4515,6 +4568,8 @@ declare module '@mappedin/react-native-sdk/sdks/packages/legacy-renderer/interna
4515
4568
  };
4516
4569
  iconSize?: number;
4517
4570
  icon?: string;
4571
+ iconFit?: 'fill' | 'cover' | 'contain';
4572
+ iconPadding: number;
4518
4573
  iconVisibilityThreshold?: number;
4519
4574
  };
4520
4575
  };
@@ -4581,6 +4636,12 @@ declare module '@mappedin/react-native-sdk/sdks/packages/legacy-renderer/interna
4581
4636
  static imagePromiseCache: {
4582
4637
  [key in number]?: Promise<HTMLImageElement>;
4583
4638
  };
4639
+ static imageDimensionsCache: {
4640
+ [key in number]: {
4641
+ width: number;
4642
+ height: number;
4643
+ };
4644
+ };
4584
4645
  get pinCanvasSize(): number;
4585
4646
  draw(context: CanvasRenderingContext2D): void;
4586
4647
  }
@@ -4661,7 +4722,7 @@ declare module '@mappedin/react-native-sdk/sdks/packages/legacy-renderer/interna
4661
4722
  map: MappedinMap | null;
4662
4723
  bearing: any;
4663
4724
  nearestNode: any;
4664
- forceBlueDot: boolean;
4725
+ hasEverReceivedFloorLevel: boolean;
4665
4726
  };
4666
4727
  export interface IBlueDotCore extends IPubSub {
4667
4728
  positionUpdater: IPositionUpdater | null;
@@ -4677,6 +4738,8 @@ declare module '@mappedin/react-native-sdk/sdks/packages/legacy-renderer/interna
4677
4738
  Whether blue dot should be allowed with missing floor level information.
4678
4739
  */
4679
4740
  forceBlueDot: boolean;
4741
+ /** Whether we have received floorLevel data and are on a floorLevel supported device */
4742
+ hasEverReceivedFloorLevel: boolean;
4680
4743
  /**
4681
4744
  The state machine for the current state of the blue dot.
4682
4745
  */
@@ -7066,21 +7129,64 @@ declare module '@mappedin/react-native-sdk/sdks/packages/legacy-renderer/private
7066
7129
  import { Sprite } from 'three';
7067
7130
  type TPosition = 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right' | 'center' | 'top' | 'bottom' | 'left' | 'right';
7068
7131
  export type TShowWatermarkOptions = {
7069
- padding?: number;
7070
- position?: TPosition;
7071
- iconOnly?: boolean;
7072
- scale?: number;
7073
- onClick?: () => void;
7132
+ /**
7133
+ * Padding in pixels. Can be a number or an object with top, right, bottom, and left properties.
7134
+ * @default 16
7135
+ * @example
7136
+ * ```ts
7137
+ * // Watermark with 20 pixels of padding on all sides
7138
+ * __showWatermark({
7139
+ * padding: 20,
7140
+ * });
7141
+ * ```
7142
+ * @example
7143
+ * ```ts
7144
+ * // Watermark with unique top, right, bottom, left padding
7145
+ * __showWatermark({
7146
+ * padding: {
7147
+ * top: 10,
7148
+ * right: 20,
7149
+ * bottom: 30,
7150
+ * left: 40,
7151
+ * },
7152
+ * });
7153
+ * ```
7154
+ */
7155
+ padding?: number | {
7156
+ top?: number;
7157
+ right?: number;
7158
+ bottom?: number;
7159
+ left?: number;
7160
+ };
7161
+ /**
7162
+ * Position of the watermark on the screen.
7163
+ * @default 'bottom-left'
7164
+ */
7165
+ position?: TPosition;
7166
+ /**
7167
+ * Show only the Mappedin icon without text.
7168
+ * @default false
7169
+ */
7170
+ iconOnly?: boolean;
7171
+ /**
7172
+ * Scale of the watermark between 0.5 and 1.5.
7173
+ * @default 1
7174
+ */
7175
+ scale?: number;
7176
+ /**
7177
+ * Callback when the watermark is clicked.
7178
+ */
7179
+ onClick?: () => void;
7074
7180
  };
7075
7181
  class WatermarkController {
7076
- #private;
7077
- static ENABLED: boolean;
7078
- static OPTIONS: Required<TShowWatermarkOptions>;
7079
- object?: Sprite;
7080
- constructor(core: ICore);
7081
- show: () => void;
7082
- hide: () => void;
7083
- resize: () => void;
7182
+ #private;
7183
+ static ENABLED: boolean;
7184
+ static OPTIONS: Required<TShowWatermarkOptions>;
7185
+ object?: Sprite;
7186
+ constructor(core: ICore);
7187
+ show: () => void;
7188
+ hide: () => void;
7189
+ resize: () => void;
7084
7190
  }
7085
7191
  export default WatermarkController;
7086
7192
  }
@@ -10434,142 +10540,126 @@ declare module '@mappedin/react-native-sdk/sdks/packages/legacy-renderer/private
10434
10540
  import { MappedinDirections, MappedinMap, MappedinNode } from '@mappedin/react-native-sdk/sdks/packages/get-venue';
10435
10541
  import { STACKED_MAPS_STATE, MapViewScene, MapViewStackScene, CAMERA_EASING_MODE } from '@mappedin/react-native-sdk/sdks/packages/legacy-renderer/internal';
10436
10542
  import type { ICore, TCameraTransform } from '@mappedin/react-native-sdk/sdks/packages/legacy-renderer/internal';
10543
+ import { TStackedMapsOptions } from '@mappedin/react-native-sdk/sdks/packages/legacy-renderer/MapView.types';
10437
10544
  enum ACTION {
10438
- enable = "enable",
10439
- disable = "disable",
10440
- showOverview = "showOverview",
10441
- zoomInToMap = "zoomInToMap",
10442
- scrollToMap = "scrollToMap",
10443
- restack = "restack"
10545
+ enable = "enable",
10546
+ disable = "disable",
10547
+ showOverview = "showOverview",
10548
+ zoomInToMap = "zoomInToMap",
10549
+ scrollToMap = "scrollToMap",
10550
+ restack = "restack"
10444
10551
  }
10445
10552
  type TTargetTransitionFunction = ((options: TParams) => () => Promise<void>) | ((options: TParams) => void);
10446
10553
  type TParams = {
10447
- map: MappedinMap;
10554
+ map: MappedinMap;
10448
10555
  } | {
10449
- directions: MappedinDirections | MappedinDirections[];
10556
+ directions: MappedinDirections | MappedinDirections[];
10450
10557
  } | {
10451
- stackScene: MapViewStackScene;
10452
- directions: MappedinDirections | MappedinDirections[];
10453
- verticalDistanceBetweenMaps?: number;
10558
+ stackScene: MapViewStackScene;
10559
+ directions: MappedinDirections | MappedinDirections[];
10560
+ verticalDistanceBetweenMaps?: number;
10454
10561
  } | {
10455
- stackScene: MapViewStackScene;
10456
- verticalDistanceBetweenMaps?: number;
10457
- map: MappedinMap;
10458
- nodes: MappedinNode[];
10562
+ stackScene: MapViewStackScene;
10563
+ verticalDistanceBetweenMaps?: number;
10564
+ map: MappedinMap;
10565
+ nodes: MappedinNode[];
10459
10566
  } | {
10460
- stackScene: MapViewStackScene;
10461
- map: MappedinMap;
10462
- nodes: MappedinNode[];
10463
- rotation: number;
10464
- cameraTransform?: TCameraTransform;
10465
- verticalDistanceBetweenMaps?: number;
10567
+ stackScene: MapViewStackScene;
10568
+ map: MappedinMap;
10569
+ nodes: MappedinNode[];
10570
+ rotation: number;
10571
+ cameraTransform?: TCameraTransform;
10572
+ verticalDistanceBetweenMaps?: number;
10466
10573
  };
10467
10574
  type TActionFn = [STACKED_MAPS_STATE, TTargetTransitionFunction[]];
10468
10575
  type TState = {
10469
- [stateName in STACKED_MAPS_STATE]?: {
10470
- actions: {
10471
- [actionName in ACTION]?: TActionFn;
10472
- };
10576
+ [stateName in STACKED_MAPS_STATE]?: {
10577
+ actions: {
10578
+ [actionName in ACTION]?: TActionFn;
10473
10579
  };
10580
+ };
10474
10581
  };
10475
10582
  export type TInternalTransitionOptions = {
10476
- animate?: boolean;
10477
- };
10478
- export type TStackedMapsOptions = {
10479
- /**
10480
- * The vertical distance between maps in overview, in metres.
10481
- * @default 50
10482
- */
10483
- verticalDistanceBetweenMaps?: number;
10484
- /**
10485
- * Whether to show map level labels in overview.
10486
- * @default true
10487
- */
10488
- mapLabels?: boolean;
10489
- /**
10490
- * Whether to show only Journey maps in the stack if a Journey is active and the current map is part of the Journey.
10491
- * @default true
10492
- */
10493
- prioritizeJourneyMaps?: boolean;
10583
+ animate?: boolean;
10494
10584
  };
10495
10585
  class StackedMapsController {
10496
- #private;
10497
- options: TStackedMapsOptions;
10498
- enabled: boolean;
10499
- stackScene: MapViewStackScene;
10500
- constructor(core: ICore);
10501
- needsUpdate: boolean;
10502
- currentState: STACKED_MAPS_STATE;
10503
- mapsInStack: MappedinMap[];
10504
- getZoomIntoMapOptions: (params: TParams) => (MapViewScene | {
10505
- activeMap: MappedinMap;
10506
- focusOn: {
10507
- targets: {
10508
- nodes: MappedinNode[];
10509
- };
10510
- options: {
10511
- zoom?: number;
10512
- tilt: number;
10513
- rotation: number;
10514
- position?: MappedinNode | import("../../internal").MappedinCoordinate;
10515
- easing: CAMERA_EASING_MODE;
10516
- };
10517
- };
10518
- })[];
10519
- getDisableOptions: (params: TParams) => (MapViewScene | {
10520
- activeMap: MappedinMap;
10521
- })[];
10522
- getShowOverviewOptions: (params: TParams) => (MapViewStackScene | {
10523
- activeMap: MappedinMap;
10524
- focusOn: {
10525
- options: {
10526
- tilt: number;
10527
- duration: number;
10528
- };
10529
- };
10530
- verticalDistanceBetweenMaps: number;
10531
- })[];
10532
- getScrollToMapOptions: (params: TParams) => (MapViewStackScene | {
10533
- focusOn: {
10534
- targets: {
10535
- nodes: MappedinNode[];
10536
- };
10537
- options: {
10538
- tilt: number;
10539
- easing: CAMERA_EASING_MODE;
10540
- };
10541
- };
10542
- activeMap: MappedinMap;
10543
- })[];
10544
- getRestackOptions: (params: TParams) => (MapViewStackScene | {
10545
- activeMap: MappedinMap;
10546
- focusOn: {
10547
- options: {
10548
- tilt: number;
10549
- duration: number;
10550
- };
10551
- };
10552
- verticalDistanceBetweenMaps: number;
10553
- })[];
10554
- getEnableOptions: () => void;
10555
- getShowOverviewTransition: (options: any, inTransit?: boolean) => () => Promise<void>;
10556
- getZoomInToMapTransition: (options: any) => () => Promise<void>;
10557
- getScrollToMapTransition: (options: any, inTransit?: boolean) => () => Promise<void>;
10558
- getRestackTransition: (options: any, inTransit?: boolean) => () => Promise<void>;
10559
- getDisableTransition: (options: any) => () => Promise<void>;
10560
- getEnableTransition: () => () => void;
10561
- states: TState;
10562
- get determineMapStack(): MappedinMap[];
10563
- transition(currentState: STACKED_MAPS_STATE, actionName: ACTION): TTargetTransitionFunction[] | void;
10564
- exec(transitions: TTargetTransitionFunction[] | void, params: TParams): Promise<void>;
10565
- disable: () => Promise<void>;
10566
- enable: (opts?: TStackedMapsOptions) => Promise<void>;
10567
- get nodesInJourneyOrMap(): any[];
10568
- showOverview: () => Promise<void>;
10569
- scrollToMap: (map: MappedinMap) => Promise<void>;
10570
- restack: (options?: TStackedMapsOptions) => Promise<void>;
10571
- zoomInToMap: (map: MappedinMap, cameraTransform?: TCameraTransform) => Promise<void>;
10572
- get currentMap(): MappedinMap;
10586
+ #private;
10587
+ options: TStackedMapsOptions;
10588
+ enabled: boolean;
10589
+ stackScene: MapViewStackScene;
10590
+ constructor(core: ICore);
10591
+ needsUpdate: boolean;
10592
+ currentState: STACKED_MAPS_STATE;
10593
+ mapsInStack: MappedinMap[];
10594
+ getZoomIntoMapOptions: (params: TParams) => (MapViewScene | {
10595
+ activeMap: MappedinMap;
10596
+ focusOn: {
10597
+ targets: {
10598
+ nodes: MappedinNode[];
10599
+ };
10600
+ options: {
10601
+ zoom?: number;
10602
+ tilt: number;
10603
+ rotation: number;
10604
+ position?: MappedinNode | import("../../internal").MappedinCoordinate;
10605
+ easing: CAMERA_EASING_MODE;
10606
+ };
10607
+ };
10608
+ })[];
10609
+ getDisableOptions: (params: TParams) => (MapViewScene | {
10610
+ activeMap: MappedinMap;
10611
+ })[];
10612
+ getShowOverviewOptions: (params: TParams) => (MapViewStackScene | {
10613
+ activeMap: MappedinMap;
10614
+ focusOn: {
10615
+ options: {
10616
+ tilt: number;
10617
+ duration: number;
10618
+ };
10619
+ };
10620
+ verticalDistanceBetweenMaps: number;
10621
+ })[];
10622
+ getScrollToMapOptions: (params: TParams) => (MapViewStackScene | {
10623
+ focusOn: {
10624
+ targets: {
10625
+ nodes: MappedinNode[];
10626
+ };
10627
+ options: {
10628
+ tilt: number;
10629
+ easing: CAMERA_EASING_MODE;
10630
+ };
10631
+ };
10632
+ activeMap: MappedinMap;
10633
+ })[];
10634
+ getRestackOptions: (params: TParams) => (MapViewStackScene | {
10635
+ activeMap: MappedinMap;
10636
+ focusOn: {
10637
+ options: {
10638
+ tilt: number;
10639
+ duration: number;
10640
+ };
10641
+ };
10642
+ verticalDistanceBetweenMaps: number;
10643
+ })[];
10644
+ getEnableOptions: () => void;
10645
+ getShowOverviewTransition: (options: any, inTransit?: boolean) => () => Promise<void>;
10646
+ getZoomInToMapTransition: (options: any) => () => Promise<void>;
10647
+ getScrollToMapTransition: (options: any, inTransit?: boolean) => () => Promise<void>;
10648
+ getRestackTransition: (options: any, inTransit?: boolean) => () => Promise<void>;
10649
+ getDisableTransition: (options: any) => () => Promise<void>;
10650
+ getEnableTransition: () => () => void;
10651
+ states: TState;
10652
+ get determineMapStack(): MappedinMap[];
10653
+ transition(currentState: STACKED_MAPS_STATE, actionName: ACTION): TTargetTransitionFunction[] | void;
10654
+ exec(transitions: TTargetTransitionFunction[] | void, params: TParams): Promise<void>;
10655
+ disable: () => Promise<void>;
10656
+ enable: (opts?: TStackedMapsOptions) => Promise<void>;
10657
+ get nodesInJourneyOrMap(): any[];
10658
+ showOverview: () => Promise<void>;
10659
+ scrollToMap: (map: MappedinMap) => Promise<void>;
10660
+ restack: (options?: TStackedMapsOptions) => Promise<void>;
10661
+ zoomInToMap: (map: MappedinMap, cameraTransform?: TCameraTransform) => Promise<void>;
10662
+ get currentMap(): MappedinMap;
10573
10663
  }
10574
10664
  export default StackedMapsController;
10575
10665
  }
@@ -11857,8 +11947,8 @@ declare module '@mappedin/react-native-sdk/sdks/packages/legacy-renderer/public/
11857
11947
 
11858
11948
  declare module '@mappedin/react-native-sdk/sdks/packages/legacy-renderer/public/api/StackedMaps' {
11859
11949
  import { MappedinMap } from '@mappedin/react-native-sdk/sdks/packages/get-venue';
11950
+ import { TStackedMapsOptions } from '@mappedin/react-native-sdk/sdks/packages/legacy-renderer/MapView.types';
11860
11951
  import { STACKED_MAPS_STATE, StackedMapsController, TCameraTransform } from '@mappedin/react-native-sdk/sdks/packages/legacy-renderer/internal';
11861
- import { TStackedMapsOptions } from '@mappedin/react-native-sdk/sdks/packages/legacy-renderer/private/controllers/StackedMapsController';
11862
11952
  /**
11863
11953
  * @experimental
11864
11954
  * API for showing multiple maps involved in a {@link Journey} as a vertical stack.
@@ -11871,7 +11961,8 @@ declare module '@mappedin/react-native-sdk/sdks/packages/legacy-renderer/public/
11871
11961
  constructor(markersController: StackedMapsController);
11872
11962
  /**
11873
11963
  * @experimental
11874
- * Enable Stacked Maps. A {@link Journey} must be drawn beforehand or this method will fail.
11964
+ * Enable Stacked Maps. If a {@link Journey} is drawn beforehand the default behaviour is to only display the floors that are part of the journey.
11965
+ * {@link TStackedMapsOptions} can be used to enabling display of all maps including those that are not part of the journey.
11875
11966
  * Use {@link showOverview} to expand the maps vertically after enabling.
11876
11967
  *
11877
11968
  * Upon enabling, map state will become {@link STATE.STACKED | STACKED} and Stacked Maps state will become {@link STACKED_MAPS_STATE.ACTIVE | ACTIVE}.
@@ -11909,7 +12000,7 @@ declare module '@mappedin/react-native-sdk/sdks/packages/legacy-renderer/public/
11909
12000
  /**
11910
12001
  * @experimental
11911
12002
  *
11912
- * Expand the maps in the current {@link Journey} vertically and add vertical paths between connections.
12003
+ * Expand and display all maps in the current {@link MapGroup}. If a {@link Journey} has been drawn, vertical paths between connections are displayed.
11913
12004
  * Stacked Maps must be enabled beforehand and state will become {@link STACKED_MAPS_STATE.OVERVIEW | OVERVIEW}.
11914
12005
  *
11915
12006
  * @example
@@ -11964,7 +12055,8 @@ declare module '@mappedin/react-native-sdk/sdks/packages/legacy-renderer/public/
11964
12055
  * @experimental
11965
12056
  *
11966
12057
  * Used when in {@link STACKED_MAPS_STATE.OVERVIEW | OVERVIEW} state to replace the maps in the
11967
- * current stack if there is a new Journey or Journey is cleared.
12058
+ * current stack after clearing or creating a {@link Journey}.
12059
+ * Use this to hide maps that are not part of the journey or to display all maps in the {@link MapGroup}.
11968
12060
  *
11969
12061
  * @param options - Options to adjust the overview. Each option defaults to the setting passed in {@link enable}, unless provided.
11970
12062
  *