@mappedin/mappedin-js 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.
@@ -0,0 +1 @@
1
+ import{b as a}from"./chunk-ZRT45YCM.js";var e,c=a((()=>{e={env:{NODE_ENV:"production",npm_package_version:"5.33.0"}}}));export{c as a,e as b};
@@ -3523,6 +3523,26 @@ declare module '@mappedin/mappedin-js/renderer/public/api/StackedMaps' {
3523
3523
  * @returns Promise when all animations are complete.
3524
3524
  */
3525
3525
  zoomInToMap: (map: MappedinMap, cameraTransform?: TCameraTransform) => Promise<void>;
3526
+ /**
3527
+ * @experimental
3528
+ *
3529
+ * Used when in {@link STACKED_MAPS_STATE.OVERVIEW | OVERVIEW} state to replace the maps in the
3530
+ * current stack if there is a new Journey or Journey is cleared.
3531
+ *
3532
+ * @param options - Options to adjust the overview. Each option defaults to the setting passed in {@link enable}, unless provided.
3533
+ *
3534
+ * @example
3535
+ * ```ts
3536
+ * mapView.Journey.draw(...);
3537
+ * mapView.StackedMaps.enable();
3538
+ * mapView.StackedMaps.showOverview();
3539
+ * mapView.Journey.clear();
3540
+ * mapView.StackedMaps.restack();
3541
+ * ```
3542
+ *
3543
+ * @returns Promise when all animations are complete.
3544
+ */
3545
+ restack: (options?: TStackedMapsOptions) => Promise<void>;
3526
3546
  /**
3527
3547
  * @experimental
3528
3548
  *
@@ -3687,6 +3707,12 @@ declare module '@mappedin/mappedin-js/renderer/public/api/Layers' {
3687
3707
  * Adds a GeoJSON Feature or FeatureCollection to the map as a layer. The layer name must be unique
3688
3708
  */
3689
3709
  addGeoJSONLayer(layerName: string, featureOrFeatureCollection: Feature<Polygon, GeoJsonProperties | null> | FeatureCollection<Polygon, GeoJsonProperties | null>): Promise<void> | undefined;
3710
+ /**
3711
+ * @experimental
3712
+ * Hides a GeoJSON layer from the map and removes it from the list of layers.
3713
+ * It will not appear in {@link getAllLayersForMap} afterwards and can be overwritten by a new layer with the same name.
3714
+ */
3715
+ removeGeoJSONLayer(layerName: string): Promise<void> | undefined;
3690
3716
  }
3691
3717
  export default LayerController;
3692
3718
  }
@@ -4810,6 +4836,7 @@ declare module '@mappedin/mappedin-js/get-venue/Mappedin.types' {
4810
4836
  clientId: string;
4811
4837
  clientSecret: string;
4812
4838
  venue: string;
4839
+ accessToken: string;
4813
4840
  };
4814
4841
  export type TAllGetVenueOptions = TGetVenueOptions | TGetVenueMVFOptions | (TProcessedMVFOptions & {
4815
4842
  perspective?: string;
@@ -6612,115 +6639,141 @@ declare module '@mappedin/mappedin-js/renderer/private/controllers/StackedMapsCo
6612
6639
  import { STACKED_MAPS_STATE, MapViewScene, MapViewStackScene, CAMERA_EASING_MODE } from '@mappedin/mappedin-js/renderer/internal';
6613
6640
  import type { ICore, TCameraTransform } from '@mappedin/mappedin-js/renderer/internal';
6614
6641
  enum ACTION {
6615
- enable = "enable",
6616
- disable = "disable",
6617
- showOverview = "showOverview",
6618
- zoomInToMap = "zoomInToMap",
6619
- scrollToMap = "scrollToMap"
6642
+ enable = "enable",
6643
+ disable = "disable",
6644
+ showOverview = "showOverview",
6645
+ zoomInToMap = "zoomInToMap",
6646
+ scrollToMap = "scrollToMap",
6647
+ restack = "restack"
6620
6648
  }
6621
6649
  type TTargetTransitionFunction = ((options: TParams) => () => Promise<void>) | ((options: TParams) => void);
6622
6650
  type TParams = {
6623
- map: MappedinMap;
6651
+ map: MappedinMap;
6624
6652
  } | {
6625
- directions: MappedinDirections | MappedinDirections[];
6653
+ directions: MappedinDirections | MappedinDirections[];
6626
6654
  } | {
6627
- stackScene: MapViewStackScene;
6628
- directions: MappedinDirections | MappedinDirections[];
6629
- verticalDistanceBetweenMaps?: number;
6655
+ stackScene: MapViewStackScene;
6656
+ directions: MappedinDirections | MappedinDirections[];
6657
+ verticalDistanceBetweenMaps?: number;
6630
6658
  } | {
6631
- stackScene: MapViewStackScene;
6632
- verticalDistanceBetweenMaps?: number;
6633
- map: MappedinMap;
6634
- nodes: MappedinNode[];
6659
+ stackScene: MapViewStackScene;
6660
+ verticalDistanceBetweenMaps?: number;
6661
+ map: MappedinMap;
6662
+ nodes: MappedinNode[];
6635
6663
  } | {
6636
- stackScene: MapViewStackScene;
6637
- map: MappedinMap;
6638
- nodes: MappedinNode[];
6639
- rotation: number;
6640
- cameraTransform?: TCameraTransform;
6641
- verticalDistanceBetweenMaps?: number;
6664
+ stackScene: MapViewStackScene;
6665
+ map: MappedinMap;
6666
+ nodes: MappedinNode[];
6667
+ rotation: number;
6668
+ cameraTransform?: TCameraTransform;
6669
+ verticalDistanceBetweenMaps?: number;
6642
6670
  };
6643
6671
  type TActionFn = [STACKED_MAPS_STATE, TTargetTransitionFunction[]];
6644
6672
  type TState = {
6645
- [stateName in STACKED_MAPS_STATE]?: {
6646
- actions: {
6647
- [actionName in ACTION]?: TActionFn;
6673
+ [stateName in STACKED_MAPS_STATE]?: {
6674
+ actions: {
6675
+ [actionName in ACTION]?: TActionFn;
6676
+ };
6648
6677
  };
6649
- };
6650
6678
  };
6651
6679
  export type TInternalTransitionOptions = {
6652
- animate?: boolean;
6680
+ animate?: boolean;
6653
6681
  };
6654
6682
  export type TStackedMapsOptions = {
6655
- verticalDistanceBetweenMaps?: number;
6656
- mapLabels?: boolean;
6683
+ /**
6684
+ * The vertical distance between maps in overview, in metres.
6685
+ * @default 50
6686
+ */
6687
+ verticalDistanceBetweenMaps?: number;
6688
+ /**
6689
+ * Whether to show map level labels in overview.
6690
+ * @default true
6691
+ */
6692
+ mapLabels?: boolean;
6693
+ /**
6694
+ * Whether to show only Journey maps in the stack if a Journey is active and the current map is part of the Journey.
6695
+ * @default true
6696
+ */
6697
+ prioritizeJourneyMaps?: boolean;
6657
6698
  };
6658
6699
  class StackedMapsController {
6659
- #private;
6660
- options: TStackedMapsOptions;
6661
- enabled: boolean;
6662
- stackScene: MapViewStackScene;
6663
- directions: MappedinDirections | MappedinDirections[];
6664
- constructor(core: ICore);
6665
- needsUpdate: boolean;
6666
- currentState: STACKED_MAPS_STATE;
6667
- mapsInJourney: MappedinMap[];
6668
- getZoomIntoMapOptions: (params: TParams) => (MapViewScene | {
6669
- activeMap: MappedinMap;
6670
- focusOn: {
6671
- targets: {
6672
- nodes: MappedinNode[];
6673
- };
6674
- options: {
6675
- zoom?: number | undefined;
6676
- tilt: number;
6677
- rotation: number;
6678
- position?: MappedinNode | import("../../internal").MappedinCoordinate | undefined;
6679
- easing: CAMERA_EASING_MODE;
6680
- };
6681
- };
6682
- })[] | undefined;
6683
- getDisableOptions: (params: TParams) => (MapViewScene | {
6684
- activeMap: MappedinMap;
6685
- })[] | undefined;
6686
- getShowOverviewOptions: (params: TParams) => (MapViewStackScene | {
6687
- activeMap: MappedinMap;
6688
- focusOn: {
6689
- options: {
6690
- tilt: number;
6691
- duration: number;
6692
- };
6693
- };
6694
- verticalDistanceBetweenMaps: number | undefined;
6695
- })[] | undefined;
6696
- getScrollToMapOptions: (params: TParams) => (MapViewStackScene | {
6697
- focusOn: {
6698
- targets: {
6699
- nodes: MappedinNode[];
6700
- };
6701
- options: {
6702
- tilt: number;
6703
- easing: CAMERA_EASING_MODE;
6704
- };
6705
- };
6706
- activeMap: MappedinMap;
6707
- })[] | undefined;
6708
- getEnableOptions: (params: TParams) => void;
6709
- getShowOverviewTransition: (options: any, inTransit?: boolean) => () => Promise<void>;
6710
- getZoomInToMapTransition: (options: any) => () => Promise<void>;
6711
- getScrollToMapTransition: (options: any, inTransit?: boolean) => () => Promise<void>;
6712
- getDisableTransition: (options: any) => () => Promise<void>;
6713
- getEnableTransition: () => () => void;
6714
- states: TState;
6715
- transition(currentState: STACKED_MAPS_STATE, actionName: ACTION): TTargetTransitionFunction[] | void;
6716
- exec(transitions: TTargetTransitionFunction[] | void, params: TParams): Promise<void>;
6717
- disable: () => Promise<void>;
6718
- enable: (opts?: TStackedMapsOptions) => Promise<void>;
6719
- get nodesInJourney(): MappedinNode[];
6720
- showOverview: () => Promise<void>;
6721
- scrollToMap: (map: MappedinMap) => Promise<void>;
6722
- zoomInToMap: (map: MappedinMap, cameraTransform?: TCameraTransform) => Promise<void>;
6723
- get currentMap(): MappedinMap;
6700
+ #private;
6701
+ options: TStackedMapsOptions;
6702
+ enabled: boolean;
6703
+ stackScene: MapViewStackScene;
6704
+ constructor(core: ICore);
6705
+ needsUpdate: boolean;
6706
+ currentState: STACKED_MAPS_STATE;
6707
+ mapsInStack: MappedinMap[];
6708
+ getZoomIntoMapOptions: (params: TParams) => (MapViewScene | {
6709
+ activeMap: MappedinMap;
6710
+ focusOn: {
6711
+ targets: {
6712
+ nodes: MappedinNode[];
6713
+ };
6714
+ options: {
6715
+ zoom?: number | undefined;
6716
+ tilt: number;
6717
+ rotation: number;
6718
+ position?: MappedinNode | import("../../internal").MappedinCoordinate | undefined;
6719
+ easing: CAMERA_EASING_MODE;
6720
+ };
6721
+ };
6722
+ })[] | undefined;
6723
+ getDisableOptions: (params: TParams) => (MapViewScene | {
6724
+ activeMap: MappedinMap;
6725
+ })[] | undefined;
6726
+ getShowOverviewOptions: (params: TParams) => (MapViewStackScene | {
6727
+ activeMap: MappedinMap;
6728
+ focusOn: {
6729
+ options: {
6730
+ tilt: number;
6731
+ duration: number;
6732
+ };
6733
+ };
6734
+ verticalDistanceBetweenMaps: number | undefined;
6735
+ })[] | undefined;
6736
+ getScrollToMapOptions: (params: TParams) => (MapViewStackScene | {
6737
+ focusOn: {
6738
+ targets: {
6739
+ nodes: MappedinNode[];
6740
+ };
6741
+ options: {
6742
+ tilt: number;
6743
+ easing: CAMERA_EASING_MODE;
6744
+ };
6745
+ };
6746
+ activeMap: MappedinMap;
6747
+ })[] | undefined;
6748
+ getRestackOptions: (params: TParams) => (MapViewStackScene | {
6749
+ activeMap: MappedinMap;
6750
+ focusOn: {
6751
+ options: {
6752
+ tilt: number;
6753
+ duration: number;
6754
+ };
6755
+ };
6756
+ verticalDistanceBetweenMaps: number | undefined;
6757
+ })[] | undefined;
6758
+ getEnableOptions: () => void;
6759
+ getShowOverviewTransition: (options: any, inTransit?: boolean) => () => Promise<void>;
6760
+ getZoomInToMapTransition: (options: any) => () => Promise<void>;
6761
+ getScrollToMapTransition: (options: any, inTransit?: boolean) => () => Promise<void>;
6762
+ getRestackTransition: (options: any, inTransit?: boolean) => () => Promise<void>;
6763
+ getDisableTransition: (options: any) => () => Promise<void>;
6764
+ getEnableTransition: () => () => void;
6765
+ states: TState;
6766
+ get determineMapStack(): MappedinMap[];
6767
+ transition(currentState: STACKED_MAPS_STATE, actionName: ACTION): TTargetTransitionFunction[] | void;
6768
+ exec(transitions: TTargetTransitionFunction[] | void, params: TParams): Promise<void>;
6769
+ disable: () => Promise<void>;
6770
+ enable: (opts?: TStackedMapsOptions) => Promise<void>;
6771
+ get nodesInJourneyOrMap(): any[];
6772
+ showOverview: () => Promise<void>;
6773
+ scrollToMap: (map: MappedinMap) => Promise<void>;
6774
+ restack: (options?: TStackedMapsOptions) => Promise<void>;
6775
+ zoomInToMap: (map: MappedinMap, cameraTransform?: TCameraTransform) => Promise<void>;
6776
+ get currentMap(): MappedinMap;
6724
6777
  }
6725
6778
  export default StackedMapsController;
6726
6779
  }
@@ -6984,7 +7037,10 @@ declare module '@mappedin/mappedin-js/renderer/private/Core.interface' {
6984
7037
  * An object containing all outlined polygons.
6985
7038
  */
6986
7039
  outlinedPolygons: Map<string, MappedinPolygon>;
6987
- cameraPlane: any;
7040
+ /**
7041
+ * A plane that is parallel to the ground and is used for raycasting.
7042
+ */
7043
+ worldPlane: Mesh;
6988
7044
  getPositionLatLon(lat: number, lon: number, map?: MappedinMap | string | null): Vector3;
6989
7045
  currentScale: number;
6990
7046
  getPositionPolygon(polygon: MappedinPolygon | string): Vector3;
@@ -7692,7 +7748,7 @@ declare module '@mappedin/mappedin-js/get-venue/pub-sub.typed' {
7692
7748
  * @template EVENT_PAYLOAD - The type of the event payload.
7693
7749
  * @template EVENT - The type of the event.
7694
7750
  */
7695
- export class PubSub<EVENT_PAYLOAD, EVENT extends keyof EVENT_PAYLOAD> {
7751
+ export class PubSub<EVENT_PAYLOAD, EVENT extends keyof EVENT_PAYLOAD = keyof EVENT_PAYLOAD> {
7696
7752
  /**
7697
7753
  * @private
7698
7754
  * @internal
@@ -8723,73 +8779,76 @@ declare module '@mappedin/mappedin-js/renderer/private/controllers/EventSystem'
8723
8779
  import type { ICore, MappedinPolygon, Collider } from '@mappedin/mappedin-js/renderer/internal';
8724
8780
  import { BlueDotManager, Path } from '@mappedin/mappedin-js/renderer/internal';
8725
8781
  class EventSystem {
8726
- core: ICore;
8727
- blueDotManager?: BlueDotManager;
8728
- rendererDomElement: any;
8729
- currentHover: string | null;
8730
- hoverLabel: any;
8731
- hoverColor: Color;
8732
- options: {
8733
- disableHover: boolean;
8734
- };
8735
- constructor(core: ICore);
8736
- setBlueDotManager: (blueDotManager: any) => void;
8737
- touchCount: number;
8738
- zoomOut(): void;
8739
- zoomIn(event: any): void;
8740
- onPointerMove: (event: any) => void;
8741
- onPointerUp: (event: any) => void;
8742
- /**
8743
- * We've confirmed that a map click has occured, so handle that here
8744
- */
8745
- handleMapClick(event: any): void;
8746
- onPointerDown: (event: any) => void;
8747
- incrementTouches: (event: any) => void;
8748
- decrementTouches: (event: any) => void;
8749
- clearMouse: () => void;
8750
- getMousePos: (event: any) => {
8751
- x: any;
8752
- y: any;
8753
- };
8754
- getScaledMousePos: (event: any) => {
8755
- x: number;
8756
- y: number;
8757
- };
8758
- cursorPos: {
8759
- x: number;
8760
- y: number;
8761
- };
8762
- mouse: {
8763
- x: number;
8764
- y: number;
8765
- };
8766
- mouseDownStart: {
8767
- time: number;
8768
- clientX: number;
8769
- clientY: number;
8770
- };
8771
- scaledCursorPos: {
8772
- x: number;
8773
- y: number;
8774
- };
8775
- hasTouched: boolean;
8776
- calculateMouseCoordinates: (event: any) => void;
8777
- getMouseRayIntersects: (objects: Object3D | Object3D[]) => import("three").Intersection<Object3D<import("three").Object3DEventMap>>[];
8778
- detectCollidersUnderMouse: () => Collider[];
8779
- detectPolygonsUnderMouse: () => string[];
8780
- detectPathsUnderMouse: () => Path[];
8781
- detectWatermarkUnderMouse: () => boolean;
8782
- detectMapsUnderMouse: () => (import("../../internal").MappedinMap | null)[];
8783
- getMouseMapPosition: () => {
8784
- x: number;
8785
- y: number;
8786
- };
8787
- checkMouseIntersectsBlueDot: () => boolean;
8788
- doHoverEffect: () => void;
8789
- onPolygonHoverOut: (polygonId: string) => false | undefined;
8790
- onPolygonHoverOver: (polygon: MappedinPolygon | string) => false | undefined;
8791
- setHoverColor: (color: string) => void;
8792
- destroy(): void;
8782
+ core: ICore;
8783
+ blueDotManager?: BlueDotManager;
8784
+ rendererDomElement: any;
8785
+ currentHover: string | null;
8786
+ hoverLabel: any;
8787
+ hoverColor: Color;
8788
+ options: {
8789
+ disableHover: boolean;
8790
+ };
8791
+ constructor(core: ICore);
8792
+ setBlueDotManager: (blueDotManager: any) => void;
8793
+ touchCount: number;
8794
+ zoomOut(): void;
8795
+ zoomIn(event: any): void;
8796
+ onPointerMove: (event: any) => void;
8797
+ onPointerUp: (event: any) => void;
8798
+ /**
8799
+ * We've confirmed that a map click has occured, so handle that here
8800
+ */
8801
+ handleMapClick(event: any): void;
8802
+ onPointerDown: (event: any) => void;
8803
+ incrementTouches: (event: any) => void;
8804
+ decrementTouches: (event: any) => void;
8805
+ clearMouse: () => void;
8806
+ getMousePos: (event: any) => {
8807
+ x: any;
8808
+ y: any;
8809
+ };
8810
+ getScaledMousePos: (event: any) => {
8811
+ x: number;
8812
+ y: number;
8813
+ };
8814
+ cursorPos: {
8815
+ x: number;
8816
+ y: number;
8817
+ };
8818
+ mouse: {
8819
+ x: number;
8820
+ y: number;
8821
+ };
8822
+ mouseDownStart: {
8823
+ time: number;
8824
+ clientX: number;
8825
+ clientY: number;
8826
+ };
8827
+ scaledCursorPos: {
8828
+ x: number;
8829
+ y: number;
8830
+ };
8831
+ hasTouched: boolean;
8832
+ calculateMouseCoordinates: (event: any) => void;
8833
+ getMouseRayIntersects: (objects: Object3D | Object3D[]) => import("three").Intersection<Object3D<import("three").Object3DEventMap>>[];
8834
+ detectCollidersUnderMouse: () => Collider[];
8835
+ detectPolygonsUnderMouse: () => string[];
8836
+ detectPathsUnderMouse: () => Path[];
8837
+ detectWatermarkUnderMouse: () => boolean;
8838
+ detectMapsUnderMouse: () => (import("../../internal").MappedinMap | null)[];
8839
+ /**
8840
+ * Gets mouse click position in x y map coordinates
8841
+ */
8842
+ getMouseMapPosition: () => {
8843
+ x: number;
8844
+ y: number;
8845
+ };
8846
+ checkMouseIntersectsBlueDot: () => boolean;
8847
+ doHoverEffect: () => void;
8848
+ onPolygonHoverOut: (polygonId: string) => false | undefined;
8849
+ onPolygonHoverOver: (polygon: MappedinPolygon | string) => false | undefined;
8850
+ setHoverColor: (color: string) => void;
8851
+ destroy(): void;
8793
8852
  }
8794
8853
  export default EventSystem;
8795
8854
  }
@@ -9311,7 +9370,7 @@ declare module '@mappedin/mappedin-js/renderer/private/controllers/ExportControl
9311
9370
  /**
9312
9371
  * Exports the current scene as a GLTF file.
9313
9372
  */
9314
- getCurrentSceneGLTF(userOptions: TGLTFExportOptions): Promise<Blob>;
9373
+ getCurrentSceneGLTF: (userOptions: TGLTFExportOptions) => Promise<Blob>;
9315
9374
  }
9316
9375
  }
9317
9376
 
@@ -9335,6 +9394,7 @@ declare module '@mappedin/mappedin-js/renderer/private/controllers/LayerControll
9335
9394
  */
9336
9395
  getVisibleLayersForLoadedMap(map: MappedinMap): string[] | undefined;
9337
9396
  addGeoJSONLayer(layerName: string, featureOrFeatureCollection: Feature<Polygon, GeoJsonProperties | null> | FeatureCollection<Polygon, GeoJsonProperties | null>): Promise<void>;
9397
+ removeGeoJSONLayer(layerName: string): Promise<void>;
9338
9398
  }
9339
9399
  export default LayerController;
9340
9400
  }
@@ -9906,7 +9966,7 @@ declare module '@mappedin/mappedin-js/renderer/private/Core' {
9906
9966
  resolution: Vector2;
9907
9967
  cameraParameters: any;
9908
9968
  controls: typeof Mappedin.CameraControls;
9909
- cameraPlane: Mesh;
9969
+ worldPlane: Mesh;
9910
9970
  canvasWidth: number;
9911
9971
  canvasHeight: number;
9912
9972
  cachedPadding: TPadding;