@mappedin/react-native-sdk 5.32.0 → 5.33.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
@@ -3642,7 +3642,10 @@ declare module '@mappedin/react-native-sdk/sdks/packages/legacy-renderer/private
3642
3642
  * An object containing all outlined polygons.
3643
3643
  */
3644
3644
  outlinedPolygons: Map<string, MappedinPolygon>;
3645
- cameraPlane: any;
3645
+ /**
3646
+ * A plane that is parallel to the ground and is used for raycasting.
3647
+ */
3648
+ worldPlane: Mesh;
3646
3649
  getPositionLatLon(lat: number, lon: number, map?: MappedinMap | string | null): Vector3;
3647
3650
  currentScale: number;
3648
3651
  getPositionPolygon(polygon: MappedinPolygon | string): Vector3;
@@ -5251,6 +5254,7 @@ declare module '@mappedin/react-native-sdk/sdks/packages/get-venue/Mappedin.type
5251
5254
  clientId: string;
5252
5255
  clientSecret: string;
5253
5256
  venue: string;
5257
+ accessToken: string;
5254
5258
  };
5255
5259
  export type TAllGetVenueOptions = TGetVenueOptions | TGetVenueMVFOptions | (TProcessedMVFOptions & {
5256
5260
  perspective?: string;
@@ -7285,7 +7289,7 @@ declare module '@mappedin/react-native-sdk/sdks/packages/legacy-renderer/private
7285
7289
  resolution: Vector2;
7286
7290
  cameraParameters: any;
7287
7291
  controls: typeof Mappedin.CameraControls;
7288
- cameraPlane: Mesh;
7292
+ worldPlane: Mesh;
7289
7293
  canvasWidth: number;
7290
7294
  canvasHeight: number;
7291
7295
  cachedPadding: TPadding;
@@ -7624,7 +7628,7 @@ declare module '@mappedin/react-native-sdk/sdks/packages/get-venue/pub-sub.typed
7624
7628
  * @template EVENT_PAYLOAD - The type of the event payload.
7625
7629
  * @template EVENT - The type of the event.
7626
7630
  */
7627
- export class PubSub<EVENT_PAYLOAD, EVENT extends keyof EVENT_PAYLOAD> {
7631
+ export class PubSub<EVENT_PAYLOAD, EVENT extends keyof EVENT_PAYLOAD = keyof EVENT_PAYLOAD> {
7628
7632
  /**
7629
7633
  * @private
7630
7634
  * @internal
@@ -10233,73 +10237,76 @@ declare module '@mappedin/react-native-sdk/sdks/packages/legacy-renderer/private
10233
10237
  import type { ICore, MappedinPolygon, Collider } from '@mappedin/react-native-sdk/sdks/packages/legacy-renderer/internal';
10234
10238
  import { BlueDotManager, Path } from '@mappedin/react-native-sdk/sdks/packages/legacy-renderer/internal';
10235
10239
  class EventSystem {
10236
- core: ICore;
10237
- blueDotManager?: BlueDotManager;
10238
- rendererDomElement: any;
10239
- currentHover: string | null;
10240
- hoverLabel: any;
10241
- hoverColor: Color;
10242
- options: {
10243
- disableHover: boolean;
10244
- };
10245
- constructor(core: ICore);
10246
- setBlueDotManager: (blueDotManager: any) => void;
10247
- touchCount: number;
10248
- zoomOut(): void;
10249
- zoomIn(event: any): void;
10250
- onPointerMove: (event: any) => void;
10251
- onPointerUp: (event: any) => void;
10252
- /**
10253
- * We've confirmed that a map click has occured, so handle that here
10254
- */
10255
- handleMapClick(event: any): void;
10256
- onPointerDown: (event: any) => void;
10257
- incrementTouches: (event: any) => void;
10258
- decrementTouches: (event: any) => void;
10259
- clearMouse: () => void;
10260
- getMousePos: (event: any) => {
10261
- x: any;
10262
- y: any;
10263
- };
10264
- getScaledMousePos: (event: any) => {
10265
- x: number;
10266
- y: number;
10267
- };
10268
- cursorPos: {
10269
- x: number;
10270
- y: number;
10271
- };
10272
- mouse: {
10273
- x: number;
10274
- y: number;
10275
- };
10276
- mouseDownStart: {
10277
- time: number;
10278
- clientX: number;
10279
- clientY: number;
10280
- };
10281
- scaledCursorPos: {
10282
- x: number;
10283
- y: number;
10284
- };
10285
- hasTouched: boolean;
10286
- calculateMouseCoordinates: (event: any) => void;
10287
- getMouseRayIntersects: (objects: Object3D | Object3D[]) => import("three").Intersection<Object3D<import("three").Object3DEventMap>>[];
10288
- detectCollidersUnderMouse: () => Collider[];
10289
- detectPolygonsUnderMouse: () => string[];
10290
- detectPathsUnderMouse: () => Path[];
10291
- detectWatermarkUnderMouse: () => boolean;
10292
- detectMapsUnderMouse: () => import("../../internal").MappedinMap[];
10293
- getMouseMapPosition: () => {
10294
- x: number;
10295
- y: number;
10296
- };
10297
- checkMouseIntersectsBlueDot: () => boolean;
10298
- doHoverEffect: () => void;
10299
- onPolygonHoverOut: (polygonId: string) => boolean;
10300
- onPolygonHoverOver: (polygon: MappedinPolygon | string) => boolean;
10301
- setHoverColor: (color: string) => void;
10302
- destroy(): void;
10240
+ core: ICore;
10241
+ blueDotManager?: BlueDotManager;
10242
+ rendererDomElement: any;
10243
+ currentHover: string | null;
10244
+ hoverLabel: any;
10245
+ hoverColor: Color;
10246
+ options: {
10247
+ disableHover: boolean;
10248
+ };
10249
+ constructor(core: ICore);
10250
+ setBlueDotManager: (blueDotManager: any) => void;
10251
+ touchCount: number;
10252
+ zoomOut(): void;
10253
+ zoomIn(event: any): void;
10254
+ onPointerMove: (event: any) => void;
10255
+ onPointerUp: (event: any) => void;
10256
+ /**
10257
+ * We've confirmed that a map click has occured, so handle that here
10258
+ */
10259
+ handleMapClick(event: any): void;
10260
+ onPointerDown: (event: any) => void;
10261
+ incrementTouches: (event: any) => void;
10262
+ decrementTouches: (event: any) => void;
10263
+ clearMouse: () => void;
10264
+ getMousePos: (event: any) => {
10265
+ x: any;
10266
+ y: any;
10267
+ };
10268
+ getScaledMousePos: (event: any) => {
10269
+ x: number;
10270
+ y: number;
10271
+ };
10272
+ cursorPos: {
10273
+ x: number;
10274
+ y: number;
10275
+ };
10276
+ mouse: {
10277
+ x: number;
10278
+ y: number;
10279
+ };
10280
+ mouseDownStart: {
10281
+ time: number;
10282
+ clientX: number;
10283
+ clientY: number;
10284
+ };
10285
+ scaledCursorPos: {
10286
+ x: number;
10287
+ y: number;
10288
+ };
10289
+ hasTouched: boolean;
10290
+ calculateMouseCoordinates: (event: any) => void;
10291
+ getMouseRayIntersects: (objects: Object3D | Object3D[]) => import("three").Intersection<Object3D<import("three").Object3DEventMap>>[];
10292
+ detectCollidersUnderMouse: () => Collider[];
10293
+ detectPolygonsUnderMouse: () => string[];
10294
+ detectPathsUnderMouse: () => Path[];
10295
+ detectWatermarkUnderMouse: () => boolean;
10296
+ detectMapsUnderMouse: () => import("../../internal").MappedinMap[];
10297
+ /**
10298
+ * Gets mouse click position in x y map coordinates
10299
+ */
10300
+ getMouseMapPosition: () => {
10301
+ x: number;
10302
+ y: number;
10303
+ };
10304
+ checkMouseIntersectsBlueDot: () => boolean;
10305
+ doHoverEffect: () => void;
10306
+ onPolygonHoverOut: (polygonId: string) => boolean;
10307
+ onPolygonHoverOver: (polygon: MappedinPolygon | string) => boolean;
10308
+ setHoverColor: (color: string) => void;
10309
+ destroy(): void;
10303
10310
  }
10304
10311
  export default EventSystem;
10305
10312
  }
@@ -10415,115 +10422,141 @@ declare module '@mappedin/react-native-sdk/sdks/packages/legacy-renderer/private
10415
10422
  import { STACKED_MAPS_STATE, MapViewScene, MapViewStackScene, CAMERA_EASING_MODE } from '@mappedin/react-native-sdk/sdks/packages/legacy-renderer/internal';
10416
10423
  import type { ICore, TCameraTransform } from '@mappedin/react-native-sdk/sdks/packages/legacy-renderer/internal';
10417
10424
  enum ACTION {
10418
- enable = "enable",
10419
- disable = "disable",
10420
- showOverview = "showOverview",
10421
- zoomInToMap = "zoomInToMap",
10422
- scrollToMap = "scrollToMap"
10425
+ enable = "enable",
10426
+ disable = "disable",
10427
+ showOverview = "showOverview",
10428
+ zoomInToMap = "zoomInToMap",
10429
+ scrollToMap = "scrollToMap",
10430
+ restack = "restack"
10423
10431
  }
10424
10432
  type TTargetTransitionFunction = ((options: TParams) => () => Promise<void>) | ((options: TParams) => void);
10425
10433
  type TParams = {
10426
- map: MappedinMap;
10434
+ map: MappedinMap;
10427
10435
  } | {
10428
- directions: MappedinDirections | MappedinDirections[];
10436
+ directions: MappedinDirections | MappedinDirections[];
10429
10437
  } | {
10430
- stackScene: MapViewStackScene;
10431
- directions: MappedinDirections | MappedinDirections[];
10432
- verticalDistanceBetweenMaps?: number;
10438
+ stackScene: MapViewStackScene;
10439
+ directions: MappedinDirections | MappedinDirections[];
10440
+ verticalDistanceBetweenMaps?: number;
10433
10441
  } | {
10434
- stackScene: MapViewStackScene;
10435
- verticalDistanceBetweenMaps?: number;
10436
- map: MappedinMap;
10437
- nodes: MappedinNode[];
10442
+ stackScene: MapViewStackScene;
10443
+ verticalDistanceBetweenMaps?: number;
10444
+ map: MappedinMap;
10445
+ nodes: MappedinNode[];
10438
10446
  } | {
10439
- stackScene: MapViewStackScene;
10440
- map: MappedinMap;
10441
- nodes: MappedinNode[];
10442
- rotation: number;
10443
- cameraTransform?: TCameraTransform;
10444
- verticalDistanceBetweenMaps?: number;
10447
+ stackScene: MapViewStackScene;
10448
+ map: MappedinMap;
10449
+ nodes: MappedinNode[];
10450
+ rotation: number;
10451
+ cameraTransform?: TCameraTransform;
10452
+ verticalDistanceBetweenMaps?: number;
10445
10453
  };
10446
10454
  type TActionFn = [STACKED_MAPS_STATE, TTargetTransitionFunction[]];
10447
10455
  type TState = {
10448
- [stateName in STACKED_MAPS_STATE]?: {
10449
- actions: {
10450
- [actionName in ACTION]?: TActionFn;
10456
+ [stateName in STACKED_MAPS_STATE]?: {
10457
+ actions: {
10458
+ [actionName in ACTION]?: TActionFn;
10459
+ };
10451
10460
  };
10452
- };
10453
10461
  };
10454
10462
  export type TInternalTransitionOptions = {
10455
- animate?: boolean;
10463
+ animate?: boolean;
10456
10464
  };
10457
10465
  export type TStackedMapsOptions = {
10458
- verticalDistanceBetweenMaps?: number;
10459
- mapLabels?: boolean;
10466
+ /**
10467
+ * The vertical distance between maps in overview, in metres.
10468
+ * @default 50
10469
+ */
10470
+ verticalDistanceBetweenMaps?: number;
10471
+ /**
10472
+ * Whether to show map level labels in overview.
10473
+ * @default true
10474
+ */
10475
+ mapLabels?: boolean;
10476
+ /**
10477
+ * Whether to show only Journey maps in the stack if a Journey is active and the current map is part of the Journey.
10478
+ * @default true
10479
+ */
10480
+ prioritizeJourneyMaps?: boolean;
10460
10481
  };
10461
10482
  class StackedMapsController {
10462
- #private;
10463
- options: TStackedMapsOptions;
10464
- enabled: boolean;
10465
- stackScene: MapViewStackScene;
10466
- directions: MappedinDirections | MappedinDirections[];
10467
- constructor(core: ICore);
10468
- needsUpdate: boolean;
10469
- currentState: STACKED_MAPS_STATE;
10470
- mapsInJourney: MappedinMap[];
10471
- getZoomIntoMapOptions: (params: TParams) => (MapViewScene | {
10472
- activeMap: MappedinMap;
10473
- focusOn: {
10474
- targets: {
10475
- nodes: MappedinNode[];
10476
- };
10477
- options: {
10478
- zoom?: number;
10479
- tilt: number;
10480
- rotation: number;
10481
- position?: MappedinNode | import("../../internal").MappedinCoordinate;
10482
- easing: CAMERA_EASING_MODE;
10483
- };
10484
- };
10485
- })[];
10486
- getDisableOptions: (params: TParams) => (MapViewScene | {
10487
- activeMap: MappedinMap;
10488
- })[];
10489
- getShowOverviewOptions: (params: TParams) => (MapViewStackScene | {
10490
- activeMap: MappedinMap;
10491
- focusOn: {
10492
- options: {
10493
- tilt: number;
10494
- duration: number;
10495
- };
10496
- };
10497
- verticalDistanceBetweenMaps: number;
10498
- })[];
10499
- getScrollToMapOptions: (params: TParams) => (MapViewStackScene | {
10500
- focusOn: {
10501
- targets: {
10502
- nodes: MappedinNode[];
10503
- };
10504
- options: {
10505
- tilt: number;
10506
- easing: CAMERA_EASING_MODE;
10507
- };
10508
- };
10509
- activeMap: MappedinMap;
10510
- })[];
10511
- getEnableOptions: (params: TParams) => void;
10512
- getShowOverviewTransition: (options: any, inTransit?: boolean) => () => Promise<void>;
10513
- getZoomInToMapTransition: (options: any) => () => Promise<void>;
10514
- getScrollToMapTransition: (options: any, inTransit?: boolean) => () => Promise<void>;
10515
- getDisableTransition: (options: any) => () => Promise<void>;
10516
- getEnableTransition: () => () => void;
10517
- states: TState;
10518
- transition(currentState: STACKED_MAPS_STATE, actionName: ACTION): TTargetTransitionFunction[] | void;
10519
- exec(transitions: TTargetTransitionFunction[] | void, params: TParams): Promise<void>;
10520
- disable: () => Promise<void>;
10521
- enable: (opts?: TStackedMapsOptions) => Promise<void>;
10522
- get nodesInJourney(): MappedinNode[];
10523
- showOverview: () => Promise<void>;
10524
- scrollToMap: (map: MappedinMap) => Promise<void>;
10525
- zoomInToMap: (map: MappedinMap, cameraTransform?: TCameraTransform) => Promise<void>;
10526
- get currentMap(): MappedinMap;
10483
+ #private;
10484
+ options: TStackedMapsOptions;
10485
+ enabled: boolean;
10486
+ stackScene: MapViewStackScene;
10487
+ constructor(core: ICore);
10488
+ needsUpdate: boolean;
10489
+ currentState: STACKED_MAPS_STATE;
10490
+ mapsInStack: MappedinMap[];
10491
+ getZoomIntoMapOptions: (params: TParams) => (MapViewScene | {
10492
+ activeMap: MappedinMap;
10493
+ focusOn: {
10494
+ targets: {
10495
+ nodes: MappedinNode[];
10496
+ };
10497
+ options: {
10498
+ zoom?: number;
10499
+ tilt: number;
10500
+ rotation: number;
10501
+ position?: MappedinNode | import("../../internal").MappedinCoordinate;
10502
+ easing: CAMERA_EASING_MODE;
10503
+ };
10504
+ };
10505
+ })[];
10506
+ getDisableOptions: (params: TParams) => (MapViewScene | {
10507
+ activeMap: MappedinMap;
10508
+ })[];
10509
+ getShowOverviewOptions: (params: TParams) => (MapViewStackScene | {
10510
+ activeMap: MappedinMap;
10511
+ focusOn: {
10512
+ options: {
10513
+ tilt: number;
10514
+ duration: number;
10515
+ };
10516
+ };
10517
+ verticalDistanceBetweenMaps: number;
10518
+ })[];
10519
+ getScrollToMapOptions: (params: TParams) => (MapViewStackScene | {
10520
+ focusOn: {
10521
+ targets: {
10522
+ nodes: MappedinNode[];
10523
+ };
10524
+ options: {
10525
+ tilt: number;
10526
+ easing: CAMERA_EASING_MODE;
10527
+ };
10528
+ };
10529
+ activeMap: MappedinMap;
10530
+ })[];
10531
+ getRestackOptions: (params: TParams) => (MapViewStackScene | {
10532
+ activeMap: MappedinMap;
10533
+ focusOn: {
10534
+ options: {
10535
+ tilt: number;
10536
+ duration: number;
10537
+ };
10538
+ };
10539
+ verticalDistanceBetweenMaps: number;
10540
+ })[];
10541
+ getEnableOptions: () => void;
10542
+ getShowOverviewTransition: (options: any, inTransit?: boolean) => () => Promise<void>;
10543
+ getZoomInToMapTransition: (options: any) => () => Promise<void>;
10544
+ getScrollToMapTransition: (options: any, inTransit?: boolean) => () => Promise<void>;
10545
+ getRestackTransition: (options: any, inTransit?: boolean) => () => Promise<void>;
10546
+ getDisableTransition: (options: any) => () => Promise<void>;
10547
+ getEnableTransition: () => () => void;
10548
+ states: TState;
10549
+ get determineMapStack(): MappedinMap[];
10550
+ transition(currentState: STACKED_MAPS_STATE, actionName: ACTION): TTargetTransitionFunction[] | void;
10551
+ exec(transitions: TTargetTransitionFunction[] | void, params: TParams): Promise<void>;
10552
+ disable: () => Promise<void>;
10553
+ enable: (opts?: TStackedMapsOptions) => Promise<void>;
10554
+ get nodesInJourneyOrMap(): any[];
10555
+ showOverview: () => Promise<void>;
10556
+ scrollToMap: (map: MappedinMap) => Promise<void>;
10557
+ restack: (options?: TStackedMapsOptions) => Promise<void>;
10558
+ zoomInToMap: (map: MappedinMap, cameraTransform?: TCameraTransform) => Promise<void>;
10559
+ get currentMap(): MappedinMap;
10527
10560
  }
10528
10561
  export default StackedMapsController;
10529
10562
  }
@@ -10551,7 +10584,7 @@ declare module '@mappedin/react-native-sdk/sdks/packages/legacy-renderer/private
10551
10584
  /**
10552
10585
  * Exports the current scene as a GLTF file.
10553
10586
  */
10554
- getCurrentSceneGLTF(userOptions: TGLTFExportOptions): Promise<Blob>;
10587
+ getCurrentSceneGLTF: (userOptions: TGLTFExportOptions) => Promise<Blob>;
10555
10588
  }
10556
10589
  }
10557
10590
 
@@ -10575,6 +10608,7 @@ declare module '@mappedin/react-native-sdk/sdks/packages/legacy-renderer/private
10575
10608
  */
10576
10609
  getVisibleLayersForLoadedMap(map: MappedinMap): string[];
10577
10610
  addGeoJSONLayer(layerName: string, featureOrFeatureCollection: Feature<Polygon, GeoJsonProperties | null> | FeatureCollection<Polygon, GeoJsonProperties | null>): Promise<void>;
10611
+ removeGeoJSONLayer(layerName: string): Promise<void>;
10578
10612
  }
10579
10613
  export default LayerController;
10580
10614
  }
@@ -11913,6 +11947,26 @@ declare module '@mappedin/react-native-sdk/sdks/packages/legacy-renderer/public/
11913
11947
  * @returns Promise when all animations are complete.
11914
11948
  */
11915
11949
  zoomInToMap: (map: MappedinMap, cameraTransform?: TCameraTransform) => Promise<void>;
11950
+ /**
11951
+ * @experimental
11952
+ *
11953
+ * Used when in {@link STACKED_MAPS_STATE.OVERVIEW | OVERVIEW} state to replace the maps in the
11954
+ * current stack if there is a new Journey or Journey is cleared.
11955
+ *
11956
+ * @param options - Options to adjust the overview. Each option defaults to the setting passed in {@link enable}, unless provided.
11957
+ *
11958
+ * @example
11959
+ * ```ts
11960
+ * mapView.Journey.draw(...);
11961
+ * mapView.StackedMaps.enable();
11962
+ * mapView.StackedMaps.showOverview();
11963
+ * mapView.Journey.clear();
11964
+ * mapView.StackedMaps.restack();
11965
+ * ```
11966
+ *
11967
+ * @returns Promise when all animations are complete.
11968
+ */
11969
+ restack: (options?: TStackedMapsOptions) => Promise<void>;
11916
11970
  /**
11917
11971
  * @experimental
11918
11972
  *
@@ -12077,6 +12131,12 @@ declare module '@mappedin/react-native-sdk/sdks/packages/legacy-renderer/public/
12077
12131
  * Adds a GeoJSON Feature or FeatureCollection to the map as a layer. The layer name must be unique
12078
12132
  */
12079
12133
  addGeoJSONLayer(layerName: string, featureOrFeatureCollection: Feature<Polygon, GeoJsonProperties | null> | FeatureCollection<Polygon, GeoJsonProperties | null>): Promise<void>;
12134
+ /**
12135
+ * @experimental
12136
+ * Hides a GeoJSON layer from the map and removes it from the list of layers.
12137
+ * It will not appear in {@link getAllLayersForMap} afterwards and can be overwritten by a new layer with the same name.
12138
+ */
12139
+ removeGeoJSONLayer(layerName: string): Promise<void>;
12080
12140
  }
12081
12141
  export default LayerController;
12082
12142
  }