@mappedin/mappedin-js 6.0.1-alpha.7 → 6.0.1-alpha.9

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.
@@ -491,7 +491,7 @@ declare module '@mappedin/mappedin-js/maker/src/events' {
491
491
  }
492
492
 
493
493
  declare module '@mappedin/mappedin-js/packages/get-venue' {
494
- import type { TGetVenueOptions, TGetVenueOptionsInternal, TVenueMetadata } from '@mappedin/mappedin-js/packages/get-venue/Mappedin.types';
494
+ import type { TAllGetVenueOptions, TGetVenueOptions, TGetVenueOptionsInternal, TVenueMetadata } from '@mappedin/mappedin-js/packages/get-venue/Mappedin.types';
495
495
  import { Mappedin } from '@mappedin/mappedin-js/packages/get-venue/Mappedin';
496
496
  import { defaultThings } from '@mappedin/mappedin-js/packages/get-venue/default-things';
497
497
  import { GET_VENUE_EVENT } from '@mappedin/mappedin-js/packages/get-venue/internal';
@@ -538,7 +538,10 @@ declare module '@mappedin/mappedin-js/packages/get-venue' {
538
538
  import { MAP_RENDER_MODE } from '@mappedin/mappedin-js/packages/get-venue/Mappedin.types';
539
539
  import { ParsedMVF } from '@mappedin/mvf';
540
540
  export { MAP_RENDER_MODE, GET_VENUE_EVENT };
541
- export function parseOptions(options: TGetVenueOptions): TGetVenueOptionsInternal & TGetVenueOptions;
541
+ /**
542
+ * @internal
543
+ */
544
+ export function parseOptions<T extends TAllGetVenueOptions>(options: T): TGetVenueOptionsInternal<T>;
542
545
  /**
543
546
  * @internal
544
547
  */
@@ -640,7 +643,7 @@ declare module '@mappedin/mappedin-js/packages/get-venue' {
640
643
  * Download a bundle and return a Mappedin instance
641
644
  * @internal
642
645
  */
643
- export function downloadBundle(userOptions: any, { url, updated_at }: {
646
+ export function downloadBundle(userOptions: TGetVenueBundleOptions, { url, updated_at }: {
644
647
  url: any;
645
648
  updated_at: any;
646
649
  }): Promise<Mappedin>;
@@ -691,7 +694,7 @@ declare module '@mappedin/mappedin-js/packages/get-venue' {
691
694
  }
692
695
 
693
696
  declare module '@mappedin/mappedin-js/packages/get-venue/Mappedin.MVF' {
694
- import { Connections, Map as MVFMap, NodeCollection, ObstructionCollection, ParsedMVF, RawMVF, SpaceCollection } from '@mappedin/mvf';
697
+ import { Connections, Map as MVFMap, NodeCollection, ObstructionCollection, ParsedMVF, RawMVF, SpaceCollection, StyleCollection } from '@mappedin/mvf';
695
698
  import { Position } from 'geojson';
696
699
  import { TCategory, TLocation, TMap, TMappedinAPI, TNode, TPolygon, TVortex } from '@mappedin/mappedin-js/packages/get-venue';
697
700
  import { MVFv1ConnectionCollection, MVFv1LevelCollection, MVFv1NodeCollection, ParsedMVFv1, RawMVFv1, WithIDs, MVFStyle } from '@mappedin/mappedin-js/packages/get-venue/Mappedin.MVF.types';
@@ -766,7 +769,7 @@ declare module '@mappedin/mappedin-js/packages/get-venue/Mappedin.MVF' {
766
769
  maxLat: number;
767
770
  maxLong: number;
768
771
  };
769
- export function convertPolygons(map: string, mvfObstructions: ObstructionCollection, mvfSpaces: SpaceCollection, deskEntrances: Map<string, TPolygon['entrances']>, styles: WithIDs<MVFStyle>, converter: CoordinateConverter): TPolygon[];
772
+ export function convertPolygons(map: string, mvfObstructions: ObstructionCollection, mvfSpaces: SpaceCollection, deskEntrances: Map<string, TPolygon['entrances']>, styles: WithIDs<MVFStyle>, layerStyles: StyleCollection, converter: CoordinateConverter): TPolygon[];
770
773
  export function convertVortexes(mvfConnections: Connections): TVortex[];
771
774
  export function convertVortexes_MVFv1(mvfConnections: MVFv1ConnectionCollection): TVortex[];
772
775
  export function overrideMVF(mvf: ParsedMVF, override?: Partial<Pick<ParsedMVF, 'styles.json'>>): ParsedMVF;
@@ -2289,6 +2292,14 @@ declare module '@mappedin/mappedin-js/maker/src/map-view-objects/camera-transfor
2289
2292
  }
2290
2293
 
2291
2294
  declare module '@mappedin/mappedin-js/packages/get-venue/Mappedin.types' {
2295
+ import type { TGetVenueMVFOptions, TGetVenueMakerOptions } from '@mappedin/mappedin-js/packages/get-venue';
2296
+ import type { DefaultThings } from '@mappedin/mappedin-js/packages/get-venue/default-things';
2297
+ export type MergedThings = {
2298
+ [key in keyof DefaultThings]: string[];
2299
+ } & {
2300
+ [k: string]: string[];
2301
+ };
2302
+ export type ThingsOption = Partial<MergedThings>;
2292
2303
  export type TGetVenueOptions = {
2293
2304
  accessToken?: string;
2294
2305
  clientId?: string;
@@ -2302,22 +2313,44 @@ declare module '@mappedin/mappedin-js/packages/get-venue/Mappedin.types' {
2302
2313
  [key in string]: string;
2303
2314
  };
2304
2315
  venue: string;
2305
- things?: any;
2316
+ /**
2317
+ * An object specifying additional properties to fetch for each data item.
2318
+ * Each key represents a data item (e.g., 'locations', 'nodes'), and the value is an array of strings indicating extra properties to be included.
2319
+ * @example
2320
+ * For example:
2321
+ * ```
2322
+ * getVenue({
2323
+ * venue: 'some-venue',
2324
+ * things: { vortexes: [ 'material' ]
2325
+ * }})
2326
+ * ```
2327
+ */
2328
+ things?: ThingsOption;
2306
2329
  useDraftData?: boolean;
2307
2330
  platformString?: string;
2308
2331
  emitAnalyticsEvents?: boolean;
2309
2332
  secure?: boolean;
2310
2333
  preloadMapGeometry?: boolean;
2311
2334
  };
2312
- export type TGetVenueOptionsInternal = {
2335
+ export type TProcessedMVFOptions = TGetVenueMakerOptions & {
2336
+ emitAnalyticsEvents: boolean;
2337
+ clientId: string;
2338
+ clientSecret: string;
2339
+ venue: string;
2340
+ };
2341
+ export type TAllGetVenueOptions = TGetVenueOptions | TGetVenueMVFOptions | (TProcessedMVFOptions & {
2342
+ perspective?: string;
2343
+ });
2344
+ export type TGetVenueOptionsInternal<T extends TAllGetVenueOptions> = Omit<T & {
2313
2345
  baseUrl?: string;
2314
2346
  supplementaryUrl?: string;
2315
2347
  noAuth?: boolean;
2316
2348
  includeHidden?: boolean;
2317
2349
  apiGateway?: string;
2318
2350
  authorization?: string;
2319
- things?: any;
2320
2351
  headers?: any;
2352
+ }, 'things'> & {
2353
+ things?: MergedThings;
2321
2354
  };
2322
2355
  export type TVenueMetadata = {
2323
2356
  languages: {
@@ -2340,14 +2373,14 @@ declare module '@mappedin/mappedin-js/packages/get-venue/Mappedin.types' {
2340
2373
 
2341
2374
  declare module '@mappedin/mappedin-js/packages/get-venue/Mappedin' {
2342
2375
  import { Navigator } from '@mappedin/mappedin-js/packages/navigator';
2343
- import type { TGetVenueOptions, TGetVenueOptionsInternal } from '@mappedin/mappedin-js/packages/get-venue/Mappedin.types';
2376
+ import type { TAllGetVenueOptions, TGetVenueOptions, TGetVenueOptionsInternal } from '@mappedin/mappedin-js/packages/get-venue/Mappedin.types';
2344
2377
  import type { MappedinNode, MappedinPolygon, MappedinLocation, MappedinCategory, MappedinVortex, MappedinVenue, MappedinTheme, MappedinRankings, MappedinLocationRankings, MappedinEvent, MappedinLocationState, MappedinMap, MappedinMapGroup, GET_VENUE_PAYLOAD } from '@mappedin/mappedin-js/packages/get-venue/internal';
2345
2378
  import { TAccessors, GET_VENUE_EVENT } from '@mappedin/mappedin-js/packages/get-venue/internal';
2346
2379
  import { IAnalytics } from '@mappedin/mappedin-js/packages/get-venue/Mappedin.CustomerAnalytics';
2347
2380
  import { ParsedMVF } from '@mappedin/mvf';
2348
2381
  import { ParsedMVFv1 } from '@mappedin/mappedin-js/packages/get-venue/Mappedin.MVF.types';
2349
2382
  import { PubSub } from '@mappedin/mappedin-js/packages/get-venue/pub-sub.typed';
2350
- export const defaultOptions: TGetVenueOptionsInternal & TGetVenueOptions;
2383
+ export const defaultOptions: TGetVenueOptionsInternal<TGetVenueOptions>;
2351
2384
  export class Mappedin extends PubSub<GET_VENUE_PAYLOAD, GET_VENUE_EVENT> {
2352
2385
  #private;
2353
2386
  perspective: any;
@@ -2579,7 +2612,7 @@ declare module '@mappedin/mappedin-js/packages/get-venue/Mappedin' {
2579
2612
  /**
2580
2613
  * @deprecated Use {@link hydrateVenue} instead
2581
2614
  */
2582
- constructor(options: TGetVenueOptionsInternal & TGetVenueOptions);
2615
+ constructor(options: TGetVenueOptionsInternal<TAllGetVenueOptions>);
2583
2616
  analytics: IAnalytics;
2584
2617
  /**
2585
2618
  * @hidden
@@ -2609,6 +2642,7 @@ declare module '@mappedin/mappedin-js/packages/get-venue/default-things' {
2609
2642
  themes: string[];
2610
2643
  rankings: string[];
2611
2644
  };
2645
+ export type DefaultThings = typeof defaultThings;
2612
2646
  }
2613
2647
 
2614
2648
  declare module '@mappedin/mappedin-js/packages/get-venue/internal' {
@@ -3737,7 +3771,7 @@ declare module '@mappedin/mappedin-js/packages/get-venue/Mappedin.MVF.types' {
3737
3771
  }
3738
3772
 
3739
3773
  declare module '@mappedin/mappedin-js/packages/get-venue/Mappedin.MVF.utils' {
3740
- import { Feature, LineString, Polygon } from '@turf/turf';
3774
+ import type { Feature, LineString, Polygon } from '@turf/turf';
3741
3775
  import { EntranceCollection, ObstructionCollection, EntranceProperties, ObstructionProperties, StyleCollection, PolygonStyle, LineStringStyle } from '@mappedin/mvf';
3742
3776
  import { MVFStyle, WithIDs } from '@mappedin/mappedin-js/packages/get-venue/Mappedin.MVF.types';
3743
3777
  export const Z_FIGHTING_ADJUSTMENT_HORIZONTAL_FACTOR = 0.2;
@@ -3751,7 +3785,7 @@ declare module '@mappedin/mappedin-js/packages/get-venue/Mappedin.MVF.utils' {
3751
3785
  */
3752
3786
  export const STATIC_MVF_FILES: readonly ["connection.json", "manifest.geojson", "map.geojson", "node.geojson", "styles.json", "mapstack.geojson"];
3753
3787
  export type TStaticMVFFiles = (typeof STATIC_MVF_FILES)[number];
3754
- export function processObstructions(obstructionCollection: ObstructionCollection, entrances: EntranceCollection, styles?: WithIDs<MVFStyle>): ObstructionCollection;
3788
+ export function processObstructions(obstructionCollection: ObstructionCollection, entrances: EntranceCollection): ObstructionCollection;
3755
3789
  export function isPolygonStyle(style: PolygonStyle | LineStringStyle | undefined): style is PolygonStyle & LineStringStyle;
3756
3790
  export function getStylesMap(styles: StyleCollection): WithIDs<MVFStyle>;
3757
3791
  }
@@ -5372,7 +5406,7 @@ declare module '@mappedin/mappedin-js/packages/legacy-renderer/MapView.types' {
5372
5406
  import type { Path } from '@mappedin/mappedin-js/packages/legacy-renderer/private/controllers/PathsController';
5373
5407
  import { TOOLTIP_ANCHOR } from '@mappedin/mappedin-js/packages/legacy-renderer/internal/Mappedin.SmartTooltip';
5374
5408
  import { GEOLOCATION_STATUS, COLLISION_RANKING_TIERS, STATE, MARKER_ANCHOR, E_SDK_EVENT, E_BLUEDOT_EVENT, E_CAMERA_EVENT, MAP_RENDER_MODE, CAMERA_EASING_MODE, E_MAP_CHANGED_REASON } from '@mappedin/mappedin-js/packages/legacy-renderer/MapView.enums';
5375
- import { TOutdoorViewControllerOptions } from '@mappedin/mappedin-js/packages/legacy-renderer/private/controllers/OutdoorViewController';
5409
+ import { TOutdoorViewOptions, TOutdoorViewOptionsWithHeaders, TOutdoorViewOptionsWithAuthURL } from '@mappedin/mappedin-js/packages/legacy-renderer/private/controllers/OutdoorViewController';
5376
5410
  export type { TEnableBlueDotOptions, TFloatingLabelAppearance };
5377
5411
  /** @internal */
5378
5412
  export type Without<T, U> = {
@@ -5880,7 +5914,7 @@ declare module '@mappedin/mappedin-js/packages/legacy-renderer/MapView.types' {
5880
5914
  * Requires `multiBufferRendering` to be enabled.
5881
5915
  * @experimental
5882
5916
  */
5883
- outdoorView?: TOutdoorViewControllerOptions & {
5917
+ outdoorView?: TOutdoorViewOptions & {
5884
5918
  enabled?: boolean;
5885
5919
  };
5886
5920
  /**
@@ -6078,7 +6112,7 @@ declare module '@mappedin/mappedin-js/packages/legacy-renderer/MapView.types' {
6078
6112
  * @experimental
6079
6113
  * Enable outdoor view. Requires multi-buffer rendering to be enabled
6080
6114
  */
6081
- outdoorView?: TOutdoorViewControllerOptions & {
6115
+ outdoorView?: TOutdoorViewOptions & {
6082
6116
  enabled?: boolean;
6083
6117
  };
6084
6118
  /**
@@ -6583,6 +6617,7 @@ declare module '@mappedin/mappedin-js/packages/legacy-renderer/MapView.types' {
6583
6617
  */
6584
6618
  [E_CAMERA_EVENT.TILT_CHANGED]: number;
6585
6619
  };
6620
+ export type { TOutdoorViewOptions, TOutdoorViewOptionsWithHeaders, TOutdoorViewOptionsWithAuthURL };
6586
6621
  export type { default as BlueDotController } from '@mappedin/mappedin-js/packages/legacy-renderer/private/controllers/BlueDotController';
6587
6622
  export type { default as Journey } from '@mappedin/mappedin-js/packages/legacy-renderer/public/api/Journey';
6588
6623
  }
@@ -8290,7 +8325,7 @@ declare module '@mappedin/mappedin-js/packages/legacy-renderer/private/scene-man
8290
8325
  }
8291
8326
 
8292
8327
  declare module '@mappedin/mappedin-js/packages/legacy-renderer/internal/Mappedin.Element' {
8293
- import { MeshLambertMaterial, Mesh, ExtrudeGeometry, Group } from 'three';
8328
+ import { MeshLambertMaterial, Mesh, ExtrudeGeometry, Vector3, Group } from 'three';
8294
8329
  import { PubSub } from '@mappedin/mappedin-js/packages/legacy-renderer/internal/pub-sub';
8295
8330
  import { AssetManager, MappedinMap, MappedinPolygon } from '@mappedin/mappedin-js/packages/legacy-renderer/internal';
8296
8331
  import { MAP_RENDER_MODE } from '@mappedin/mappedin-js/packages/legacy-renderer/MapView.enums';
@@ -8305,25 +8340,21 @@ declare module '@mappedin/mappedin-js/packages/legacy-renderer/internal/Mappedin
8305
8340
  assetManager: AssetManager;
8306
8341
  imageVisible: boolean;
8307
8342
  labelVisible: boolean;
8308
- boundingBox: {
8309
- min: {
8310
- x: number;
8311
- y: number;
8312
- z: number;
8313
- };
8314
- max: {
8315
- x: number;
8316
- y: number;
8317
- z: number;
8318
- };
8319
- };
8320
8343
  polygonHeight: number;
8321
8344
  geometry: ExtrudeGeometry;
8322
8345
  mesh: Mesh;
8323
8346
  material: MeshLambertMaterial | MeshLambertMaterial[];
8324
8347
  labelMesh?: Mesh;
8325
8348
  imageMesh?: Mesh;
8349
+ /**
8350
+ * For the time being we indicate inflated walls so they don't add to ray casting. Since these are walls it's a good optimization
8351
+ */
8352
+ isInflated: boolean;
8326
8353
  sortScore: number | null;
8354
+ boundingBox?: {
8355
+ min: Vector3;
8356
+ max: Vector3;
8357
+ };
8327
8358
  static materials: {
8328
8359
  [key in string]: MeshLambertMaterial | MeshLambertMaterial[];
8329
8360
  };
@@ -8339,20 +8370,13 @@ declare module '@mappedin/mappedin-js/packages/legacy-renderer/internal/Mappedin
8339
8370
  x: number;
8340
8371
  y: number;
8341
8372
  };
8342
- static _makeFromCoords(className: any, coords: any, mapClass: any): any;
8373
+ static _makeFromCoords(className: any, coords: any, mapClass: any, element: any): any;
8374
+ static _inflate(coords: any, width: any): any;
8343
8375
  static _setPolygonDefaults(poly: any): any;
8344
8376
  constructor(poly: MappedinPolygon, mapClass: MappedinMap, container: Group, assetManager: any, mapLoadingStrategy?: MAP_RENDER_MODE);
8345
8377
  getBoundingBox(): {
8346
- min: {
8347
- x: number;
8348
- y: number;
8349
- z: number;
8350
- };
8351
- max: {
8352
- x: number;
8353
- y: number;
8354
- z: number;
8355
- };
8378
+ min: Vector3;
8379
+ max: Vector3;
8356
8380
  };
8357
8381
  load(): Promise<this>;
8358
8382
  _addLabel(poly: MappedinPolygon, mapClass: MappedinMap): void;
@@ -9797,45 +9821,97 @@ declare module '@mappedin/mappedin-js/packages/legacy-renderer/private/controlle
9797
9821
  import './OutdoorViewController.scss';
9798
9822
  import type { ICore } from '@mappedin/mappedin-js/packages/legacy-renderer/internal';
9799
9823
  import { XOR } from '@mappedin/mappedin-js/packages/legacy-renderer/MapView.types';
9824
+ /**
9825
+ * Represents the possible positions for map attribution.
9826
+ */
9800
9827
  export type TAttributionPosition = 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right';
9801
- export type TOutdoorViewControllerOptionsWithHeaders = {
9802
- url?: string;
9803
- attributionPosition?: TAttributionPosition;
9804
- customAttribution?: string | string[];
9805
- headers: {
9806
- [key: string]: string | null;
9807
- };
9828
+ /**
9829
+ * Defines the options for an Outdoor View when initialized with headers for authentication.
9830
+ */
9831
+ export type TOutdoorViewOptionsWithHeaders = {
9832
+ /**
9833
+ * The URL to the map style file.
9834
+ * @see https://github.com/maplibre/maplibre-style-spec/
9835
+ */
9836
+ url?: string;
9837
+ /**
9838
+ * The position on the map where the attribution should be displayed.
9839
+ * @default 'bottom-right'
9840
+ */
9841
+ attributionPosition?: 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right';
9842
+ /**
9843
+ * Custom text or an array of texts to be used for the map attribution.
9844
+ */
9845
+ customAttribution?: string | string[];
9846
+ /**
9847
+ * An object containing HTTP headers for authentication purposes.
9848
+ * */
9849
+ headers: {
9850
+ [key: string]: string | null;
9851
+ };
9808
9852
  };
9809
- export type TOutdoorViewControllerOptionsWithAuthURL = {
9810
- url?: string;
9811
- authURL?: string;
9812
- customAttribution?: string | string[];
9813
- attributionPosition?: TAttributionPosition;
9853
+ /**
9854
+ * Defines the options for an Outdoor View when initialized with a URL for authentication.
9855
+ */
9856
+ export type TOutdoorViewOptionsWithAuthURL = {
9857
+ /**
9858
+ * The URL to the map style file.
9859
+ * @see https://github.com/maplibre/maplibre-style-spec/
9860
+ */
9861
+ url?: string;
9862
+ /**
9863
+ * The URL to obtain an authentication token.
9864
+ */
9865
+ authURL?: string;
9866
+ /**
9867
+ * Custom text or an array of texts to be used for the map attribution.
9868
+ */
9869
+ customAttribution?: string | string[];
9870
+ /**
9871
+ * The position on the map where the attribution should be displayed.
9872
+ * @default 'bottom-right'
9873
+ */
9874
+ attributionPosition?: 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right';
9814
9875
  };
9815
- export type TOutdoorViewControllerOptions = XOR<TOutdoorViewControllerOptionsWithHeaders, TOutdoorViewControllerOptionsWithAuthURL>;
9876
+ /**
9877
+ * Defines the options for initializing an Outdoor View.
9878
+ * This is a union type that requires exclusive or logic,
9879
+ * ensuring that an instance can either have headers or
9880
+ * an authentication URL, but not both.
9881
+ *
9882
+ * Note: It isn't permitted to use `.headers` and `.authURL` options simultaneously.
9883
+ *
9884
+ * @property {string} [url] - The URL to the map style file.
9885
+ * @property {TAttributionPosition} [attributionPosition='bottom-right'] - The position on the map where the attribution should be displayed.
9886
+ * @property {string | string[]} [customAttribution] - Custom text or an array of texts to be used for the map attribution.
9887
+ * @property {Object.<string, string | null>} [headers] - An object containing HTTP headers for authentication purposes. It isn't permitted to use `.headers` and `.authURL` options simultaneously.
9888
+ * @property {string} [authURL] - The URL to obtain an authentication token. It isn't permitted to use `.headers` and `.authURL` options simultaneously.
9889
+ * @interface
9890
+ */
9891
+ export type TOutdoorViewOptions = XOR<TOutdoorViewOptionsWithHeaders, TOutdoorViewOptionsWithAuthURL>;
9816
9892
  class OutdoorViewController {
9817
- _attribution: any;
9818
- core: ICore;
9819
- map: any;
9820
- enabled: boolean;
9821
- hidden: boolean;
9822
- url: string;
9823
- authURL: string;
9824
- headers?: TOutdoorViewControllerOptions['headers'];
9825
- customAttribution?: string | string[];
9826
- attributionPosition?: TAttributionPosition;
9827
- loaded: boolean;
9828
- constructor(core: ICore, options?: TOutdoorViewControllerOptions);
9829
- module: any;
9830
- load(): Promise<void>;
9831
- get attributions(): any;
9832
- hide(): void;
9833
- show(): void;
9834
- resize(): void;
9835
- getRequestHeaders: () => Promise<TOutdoorViewControllerOptions['headers']>;
9836
- render(): void;
9837
- setStyle(style: any): void;
9838
- setAttributionPosition(position: TAttributionPosition): void;
9893
+ _attribution: any;
9894
+ core: ICore;
9895
+ map: any;
9896
+ enabled: boolean;
9897
+ hidden: boolean;
9898
+ url: string;
9899
+ authURL: string;
9900
+ headers?: TOutdoorViewOptions['headers'];
9901
+ customAttribution?: string | string[];
9902
+ attributionPosition?: TAttributionPosition;
9903
+ loaded: boolean;
9904
+ constructor(core: ICore, options?: TOutdoorViewOptions);
9905
+ module: any;
9906
+ load(): Promise<void>;
9907
+ get attributions(): any;
9908
+ hide(): void;
9909
+ show(): void;
9910
+ resize(): void;
9911
+ getRequestHeaders: () => Promise<TOutdoorViewOptions['headers']>;
9912
+ render(): void;
9913
+ setStyle(style: any): void;
9914
+ setAttributionPosition(position: TAttributionPosition): void;
9839
9915
  }
9840
9916
  export default OutdoorViewController;
9841
9917
  }
@@ -10092,158 +10168,9 @@ declare module '@mappedin/mappedin-js/packages/legacy-renderer/internal/Mappedin
10092
10168
  }
10093
10169
 
10094
10170
  declare module '@mappedin/mappedin-js/packages/legacy-renderer/internal/utils' {
10095
- import { Box3, Vector3, Object3D, Material } from 'three';
10096
- import { Mappedin, MapObject, MappedinMap, TMapViewOptions } from '@mappedin/mappedin-js/packages/legacy-renderer/internal';
10097
- import { Camera } from '@mappedin/mappedin-js/packages/legacy-renderer/public/api/Camera';
10098
- /**
10099
- * Utils function listing
10100
- *
10101
- * - scrubMaterial
10102
- * - getObjectID
10103
- * - getObject
10104
- * - getBoundingBox
10105
- * - getBiggestBoundingBox
10106
- * - upackBoundingBox
10107
- * - getMapScale
10108
- * - throttle -> taken from lodash.js
10109
- * - getProjectionScaleFactor
10110
- * - getZoom
10111
- */
10112
- export function isGatewayKey(key: string): boolean;
10113
- export function getCombinedBoundingBox(objects: Object3D[]): Box3;
10114
- export function getMapsBoundingBox(maps: MapObject[], mapPadding: number): Box3;
10115
- export function scrubMaterial(material: Material): void;
10116
- /**
10117
- * Takes a Mappedin Object or id and returns the ID, so our functions can take bottomRight
10118
- * @template T extends string | {id: string}
10119
- * @param {T} object - input can be object containing id or the id itself
10120
- * @return {string}
10121
- */
10122
- export function getObjectId(object: any): string;
10123
- /**
10124
- * Takes a Mappedin object or ID and the array to look in and retuns the Object, so our functions can take both
10125
- */
10126
- export function getObject<K extends {
10127
- id: string;
10128
- }, T extends K | string>(obj: T, array: K[] | undefined): K | undefined;
10129
- export function getBoundingBox(object: Object3D): Box3;
10130
- /**
10131
- * Function pushes the items of the second array onto the first array (inplace).
10132
- * @template T
10133
- * @param {Array.<T>} arr1 - base array
10134
- * @param {Array.<T>} arr2 - array which items will be pushed to arr1
10135
- */
10136
- export function appendItems<T>(arr1: T[], arr2: T[]): void;
10137
- export function getBiggestBoundingBox(objects: Object3D[]): {
10138
- min: any;
10139
- max: any;
10140
- };
10141
- export function unpackBoundingBox(boundingBox: Box3): Vector3[];
10142
- export function getMapScale(map: MappedinMap): number;
10143
- export function getNorth(map: MappedinMap): number;
10144
- export function throttle<T>(func: () => void, wait: number, options?: any): () => void;
10145
- export function debounce<T>(func: () => void, wait: number, immediate?: boolean): () => void;
10146
- export function flatten(list: any[]): any[];
10147
- export function uniq(arr: any[]): any[];
10148
- export function toStyleString(styles: Record<string, string>): string;
10149
- /**
10150
- /* getProjectionScaleFactor()
10151
- /* finds the scale ratio between screen coordinates and 3D coordinates (in X-Z plane)
10152
- /*
10153
- * R
10154
- * /|
10155
- * C : Camera / |
10156
- * PQ : Projection Plane / |
10157
- * OR : Origin / |
10158
- * F : FOV / |
10159
- * Q / |
10160
- * /| |
10161
- * / | |
10162
- * / | |
10163
- * / | |
10164
- * / | |
10165
- * / F/2 | |
10166
- * C ------------P------------ O
10167
- *
10168
- *
10169
- * ProjectionScaleFactor = ( OR / PQ )
10170
- * PQ = canvasHeight / 2
10171
- * CQ = zoom
10172
- *
10173
- * OR / C0 = tan(F/2)
10174
- * so OR = CO * tan(F/2)
10175
- */
10176
- export function getProjectionScaleFactor(FOV: number, canvasHeight: number, zoom: number): number;
10177
- /** getZoom
10178
- *
10179
- * C - Camera, OP -- picture plane (canvas), S - origin,
10180
- * QR - front side of maps Bounding Box, F: FOV
10181
- *
10182
- * Z-axis
10183
- * R_____|______
10184
- * /| | |
10185
- * / | | |
10186
- * P/ | | | maps BB
10187
- * /| | | |
10188
- * / | | | |
10189
- * / | | | |
10190
- * / F |E |T |S |
10191
- * C /--------|-----|-----|-----|------ orthogonal to Y axis, midpoint of focus maps
10192
- * \ | | | |
10193
- * \ | | | |
10194
- * \ | | | |
10195
- * \ | | | |
10196
- * \| | | |
10197
- * O\ | | |
10198
- * \ | | |
10199
- * \|_____|_____|
10200
- * Q
10201
- *
10202
- *
10203
- * We want to get CS, which is the camera zoom
10204
- *
10205
- */
10206
- export function getZoom(focusBox: Box3, focusBoxHeight: number, FOV: number): number;
10207
- interface CalculateTwoDProjectionsParams {
10208
- maps: MapObject[];
10209
- width: number;
10210
- height: number;
10211
- camera: Camera;
10212
- }
10213
- export function calculateTwoDProjections({ maps, width, height, camera }: CalculateTwoDProjectionsParams): {
10214
- min: {
10215
- x: number;
10216
- y: number;
10217
- };
10218
- max: {
10219
- x: number;
10220
- y: number;
10221
- };
10222
- }[];
10223
- export function splitLine(startNode: Vector3, endNode: Vector3, segments: number): Vector3[];
10224
- export function isObject(item: any): boolean;
10225
- export const determineStartingMap: (venue: Mappedin, options: TMapViewOptions) => MappedinMap;
10226
- export function cyrb53(str: string, seed?: number): number;
10227
- export function addMarginMultiplierToBoundingBox(bbox: Box3, multiplier: number): Box3;
10228
- export function tweenPromise({ from, to, duration, easing, delay, onUpdate, onStart, onComplete, }: {
10229
- from: any;
10230
- to: any;
10231
- duration?: number | undefined;
10232
- easing?: any;
10233
- delay?: number | undefined;
10234
- onUpdate?: ((_: any) => void) | undefined;
10235
- onStart?: (() => void) | undefined;
10236
- onComplete?: (() => void) | undefined;
10237
- }): {
10238
- start(core: any): Promise<void>;
10239
- };
10240
- export const linearEase: (t: number) => number;
10241
- export const quadEaseIn: (t: number) => number;
10242
- export const quadEaseOut: (t: number) => number;
10243
- export function interpolate(value: number, inputMin: number, inputMax: number, outputMin: number, outputMax: number, easeFunc?: (t: number) => number): number;
10244
- export function interpolateMulti(value: number, inputRange: number[], outputRange: number[], easeFunc?: (t: number) => number): number;
10245
- export function checkWritableBeforeWrite(obj: any, key: string, value: any): void;
10246
- export {};
10171
+ export * from '@mappedin/mappedin-js/packages/legacy-renderer/internal/utils/utils';
10172
+ export { shouldDisableOffscreenCanvas } from '@mappedin/mappedin-js/packages/legacy-renderer/internal/utils/browser';
10173
+ export { throttle, debounce } from '@mappedin/mappedin-js/packages/legacy-renderer/internal/utils/async';
10247
10174
  }
10248
10175
 
10249
10176
  declare module '@mappedin/mappedin-js/packages/legacy-renderer/internal/Mappedin.MapManager' {
@@ -12317,12 +12244,12 @@ declare module '@mappedin/mappedin-js/packages/get-venue/MappedinMapGroup' {
12317
12244
  }
12318
12245
 
12319
12246
  declare module '@mappedin/mappedin-js/packages/get-venue/utils' {
12320
- import type { TGetVenueOptions, TGetVenueOptionsInternal } from '@mappedin/mappedin-js/packages/get-venue/Mappedin.types';
12247
+ import type { MergedThings, TGetVenueOptions, TGetVenueOptionsInternal, ThingsOption } from '@mappedin/mappedin-js/packages/get-venue/Mappedin.types';
12321
12248
  import type { MappedinMap } from '@mappedin/mappedin-js/packages/get-venue/internal';
12322
12249
  import { Mappedin, MappedinNavigatable, MappedinNode, MappedinPolygon, MappedinLocation, MappedinCoordinate } from '@mappedin/mappedin-js/packages/get-venue/internal';
12323
12250
  export function isGatewayKey(key: string): boolean;
12324
12251
  export function stringifyQuery(query: any, gateway?: boolean): string;
12325
- export function buildUrl(options: TGetVenueOptionsInternal & TGetVenueOptions, pathname: string, query: any, supplementary?: boolean): string;
12252
+ export function buildUrl(options: TGetVenueOptionsInternal<TGetVenueOptions>, pathname: string, query: any, supplementary?: boolean): string;
12326
12253
  /**
12327
12254
  * Make a network request to the Mappedin API to fetch an array of objects.
12328
12255
  * @param options options from getVenue- baseUrl and supplementaryUrl are used
@@ -12331,7 +12258,7 @@ declare module '@mappedin/mappedin-js/packages/get-venue/utils' {
12331
12258
  * @param supplementary whether to use the supplementaryUrl when sending the request
12332
12259
  * @returns the result json
12333
12260
  */
12334
- export function getArray(options: TGetVenueOptionsInternal & TGetVenueOptions, pathname: string, query: any, supplementary?: boolean): Promise<any>;
12261
+ export function getArray(options: TGetVenueOptionsInternal<TGetVenueOptions>, pathname: string, query: any, supplementary?: boolean): Promise<any>;
12335
12262
  /**
12336
12263
  * Make a network request to the Mappedin API to fetch an object.
12337
12264
  * @param options options from getVenue- baseUrl and supplementaryUrl are used
@@ -12341,21 +12268,21 @@ declare module '@mappedin/mappedin-js/packages/get-venue/utils' {
12341
12268
  * @param isExpectingArray whether the endpoint returns an array
12342
12269
  * @returns the result json
12343
12270
  */
12344
- export function getObject(options: TGetVenueOptionsInternal & TGetVenueOptions, pathname: string, query: any, supplementary?: boolean, isExpectingArray?: boolean): Promise<any>;
12271
+ export function getObject(options: TGetVenueOptionsInternal<TGetVenueOptions>, pathname: string, query: any, supplementary?: boolean, isExpectingArray?: boolean): Promise<any>;
12345
12272
  /**
12346
12273
  * Prepares the request and URL fields to pass into generateAPIRequest
12347
12274
  * @param options options from getVenue- baseUrl and supplementaryUrl are used
12348
12275
  * @param url string describing the url corresponding to the client's request
12349
12276
  * @param supplementary whether to use the supplementaryUrl when sending the request
12350
12277
  */
12351
- export function constructParamsForRequest(options: TGetVenueOptionsInternal & TGetVenueOptions, url: string, supplementary?: boolean): {
12278
+ export function constructParamsForRequest(options: TGetVenueOptionsInternal<TGetVenueOptions>, url: string, supplementary?: boolean): {
12352
12279
  req: {
12353
12280
  method: string;
12354
12281
  headers: any;
12355
12282
  };
12356
12283
  url: string;
12357
12284
  };
12358
- export function generateAPIRequest(options: TGetVenueOptionsInternal & TGetVenueOptions, url: string, supplementary?: boolean): Promise<any>;
12285
+ export function generateAPIRequest(options: TGetVenueOptionsInternal<TGetVenueOptions>, url: string, supplementary?: boolean): Promise<any>;
12359
12286
  export function addToSet(array: any, value: any): void;
12360
12287
  export function getDistanceBetweenLatLon([lat1, lon1]: [number, number], [lat2, lon2]: [number, number]): any;
12361
12288
  export function getMapScale(map: MappedinMap): any;
@@ -12389,6 +12316,7 @@ declare module '@mappedin/mappedin-js/packages/get-venue/utils' {
12389
12316
  * @return {MappedinLocation}
12390
12317
  */
12391
12318
  export const getPrimaryLocationForPolygon: (polygon: MappedinPolygon | string | undefined, venue: Mappedin) => MappedinLocation | null;
12319
+ export function mergeThings(thingsOption: ThingsOption | undefined): MergedThings;
12392
12320
  }
12393
12321
 
12394
12322
  declare module '@mappedin/mappedin-js/packages/get-venue/Mappedin.cache' {
@@ -12874,7 +12802,7 @@ declare module '@mappedin/mappedin-js/packages/legacy-renderer/internal/quad-tre
12874
12802
  }
12875
12803
 
12876
12804
  declare module '@mappedin/mappedin-js/packages/legacy-renderer/internal/shave-text' {
12877
- export type TDrawFn = (ctx: CanvasRenderingContext2D, x: number, y: number) => void;
12805
+ export type TDrawFn = (ctx: CanvasRenderingContext2D | OffscreenCanvasRenderingContext2D, x: number, y: number) => void;
12878
12806
  type TShave = (str: string, size: number, maxWidth: number, maxLines?: number, lineHeight?: number, options?: {
12879
12807
  strokeText: boolean;
12880
12808
  }) => {
@@ -13093,242 +13021,201 @@ declare module '@mappedin/mappedin-js/packages/legacy-renderer/internal/Mappedin
13093
13021
  }
13094
13022
  }
13095
13023
 
13096
- declare module '@mappedin/mappedin-js/packages/legacy-renderer/public/api/Camera' {
13097
- import { E_CAMERA_DIRECTION } from '@mappedin/mappedin-js/packages/legacy-renderer/MapView.enums';
13098
- import CameraController, { TCameraAnimationOptions, TCameraInteractionsSetOptions, TCameraTargets, TCameraTransform, TFocusOnCameraOptions } from '@mappedin/mappedin-js/packages/legacy-renderer/private/controllers/CameraController';
13024
+ declare module '@mappedin/mappedin-js/packages/legacy-renderer/internal/utils/utils' {
13025
+ import { Box3, Vector3, Object3D, Material } from 'three';
13026
+ import { Mappedin, MapObject, MappedinMap, TMapViewOptions } from '@mappedin/mappedin-js/packages/legacy-renderer/internal';
13027
+ import { Camera } from '@mappedin/mappedin-js/packages/legacy-renderer/public/api/Camera';
13099
13028
  /**
13100
- * API to control and respond to the state of the camera within the scene.
13029
+ * Utils function listing
13030
+ *
13031
+ * - scrubMaterial
13032
+ * - getObjectID
13033
+ * - getObject
13034
+ * - getBoundingBox
13035
+ * - getBiggestBoundingBox
13036
+ * - upackBoundingBox
13037
+ * - getMapScale
13038
+ * - throttle -> taken from lodash.js
13039
+ * - getProjectionScaleFactor
13040
+ * - getZoom
13101
13041
  */
13102
- export class Camera {
13103
- #private;
13104
- /**
13105
- * @hidden
13106
- */
13107
- constructor(controller: CameraController);
13108
- /**
13109
- * Subscribe a function to be called when an {@link E_CAMERA_EVENT} is fired.
13110
- *
13111
- * ```ts
13112
- * const cameraChangedHandler = ({ tilt, position, zoom, rotation }) => {
13113
- * // Do something with the new values
13114
- * };
13115
- * mapView.Camera.on(E_CAMERA_EVENT.CHANGED, cameraChangedHandler);
13116
- * ```
13117
- *
13118
- * @param eventName An {@link E_CAMERA_EVENT} that is fired when the camera changes.
13119
- * @param fn A callback that gets called when the corresponding event is fired. The
13120
- * callback will get passed an argument with a type that's one of {@link CAMERA_EVENT_PAYLOAD}.
13121
- */
13122
- on: CameraController['on'];
13123
- /**
13124
- * Unsubscribe a function that was previously subscribed with {@link on}.
13125
- *
13126
- * ```ts
13127
- * mapView.Camera.on(E_CAMERA_EVENT.CHANGED, cameraChangedHandler);
13128
- *
13129
- * ...
13130
- *
13131
- * // Something changed and I no longer want this event to fire
13132
- * mapView.Camera.off(E_CAMERA_EVENT.CHANGED, cameraChangedHandler);
13133
- * ```
13134
- *
13135
- * @param eventName An {@link E_CAMERA_EVENT} that is fired when the camera changes.
13136
- * @param fn A function that was previously passed to {@link on}. The function must
13137
- * have the same reference as the function that was subscribed.
13138
- */
13139
- off: CameraController['off'];
13140
- /**
13141
- * The current camera animation, if any. Resolves when the animation finishes.
13142
- */
13143
- get currentAnimation(): Promise<undefined> | undefined;
13144
- /**
13145
- * Current Camera zoom (in meters)
13146
- */
13147
- get zoom(): number;
13148
- /**
13149
- * Current Camera rotation (in radians) from north
13150
- */
13151
- get rotation(): number;
13152
- /**
13153
- * Current camera tilt angle (in radians), relative to a top-down view.
13154
- *
13155
- * ex: 0 means the camera is facing top-down, π/2 means the camera is
13156
- * facing directly from the side.
13157
- */
13158
- get tilt(): number;
13159
- /**
13160
- * Get the minimum distance (in meters) the camera is allowed to get to the ground.
13161
- */
13162
- get minZoom(): number;
13163
- /**
13164
- * Set the minimum distance (in meters) the camera is allowed to get to the ground.
13165
- */
13166
- set minZoom(meters: number);
13167
- /**
13168
- * Get the maximum distance (in meters) the camera is allowed to get from the ground.
13169
- */
13170
- get maxZoom(): number;
13171
- /**
13172
- * Set the maximum distance (in meters) the camera is allowed to get from the ground.
13173
- */
13174
- set maxZoom(meters: number);
13175
- /**
13176
- * Get the current maximum tilt angle (in radians) the camera is allowed to use.
13177
- */
13178
- get maxTilt(): number;
13179
- /**
13180
- * Sets the maximum tilt angle (in radians) the camera is allowed to use.
13181
- *
13182
- * Tilt angle must be between 0 and π/2 radians. It will be clamped within
13183
- * this range if it exceeds it on either end.
13184
- *
13185
- * As tilt angle approaches π/2 radians, this will impact overall touch controls
13186
- * and should be used sparingly.
13187
- */
13188
- set maxTilt(radians: number);
13189
- /**
13190
- * Get the current camera position, which is at the center of the map.
13191
- * @returns the position as a coordinate
13192
- */
13193
- get position(): import("../../index.rn").MappedinCoordinate;
13194
- /**
13195
- * Enable or disable the ability for the user to interact with the camera (e.g. pan, zoom, tilt, etc).
13196
- * This does not affect programmatic camera controls, such as {@link set} and {@link focusOn}.
13197
- *
13198
- * ```ts
13199
- * // The user can no longer interact to move the camera
13200
- * mapView.Camera.interactions.disable();
13201
- *
13202
- * // The user can now interact to move the camera again
13203
- * mapView.Camera.interactions.enable();
13204
- * ```
13205
- */
13206
- interactions: {
13207
- /**
13208
- * Enable or disable specific user interactions.
13209
- *
13210
- * ```ts
13211
- * mapView.Camera.interactions.set({ zoom: false });
13212
- * ```
13213
- *
13214
- * @param options An object defining the interactions to switch on or off.
13215
- *
13216
- */
13217
- set: (options: TCameraInteractionsSetOptions) => void;
13218
- /**
13219
- * Enable all user interactions.
13220
- */
13221
- enable: () => void;
13222
- /**
13223
- * Disable all user interactions.
13224
- */
13225
- disable: () => void;
13226
- };
13227
- /**
13228
- * Define an area of the screen that is safe for the camera. Anything outside the safe area is
13229
- * assumed to be covered in some way (e.g. by UI) meaning the camera will not place
13230
- * any map elements there when calling {@link focusOn}.
13231
- *
13232
- * ```ts
13233
- * // The top 100px of the canvas are covered by a UI element
13234
- * mapView.Camera.setSafeAreaInsets({ top: 100, left: 0, bottom: 0, right: 0});
13235
- * mapView.Camera.focusOn({ nodes });
13236
- * ```
13237
- *
13238
- * @param insets An object defining a number of pixels from the top, left, bottom, and right of
13239
- * the screen. Only the area within the padding defined by these pixels is considered safe.
13240
- */
13241
- setSafeAreaInsets(insets: {
13242
- top: number;
13243
- left: number;
13244
- bottom: number;
13245
- right: number;
13246
- }): void;
13247
- /**
13248
- * Retrieve the values previously set by {@link setSafeAreaInsets}.
13249
- *
13250
- * @returns An object defining a number of pixels from the top, left, bottom, and right of
13251
- * the screen.
13252
- */
13253
- getSafeAreaInsets(): import("../../MapView.types").TPadding;
13254
- /**
13255
- * Animate the camera to focus on a collection of targets. To control where the targets should
13256
- * be placed on screen, either specify `safeAreaInsets` on the {@link TFocusOnCameraOptions}
13257
- * or call {@link setSafeAreaInsets}.
13258
- *
13259
- * ```ts
13260
- * const location = mapView.venue.locations.find((l) => l.name === "My Location")!;
13261
- *
13262
- * mapView.Camera.focusOn({
13263
- * polygons: location.polygons,
13264
- * nodes: location.nodes,
13265
- * });
13266
- * ```
13267
- *
13268
- * @param targets A collection of things that the camera will place into view at the end of the
13269
- * animation.
13270
- * @param options
13271
- * @returns a Promise that resolves when the animation finishes, or rejects when it is cancelled.
13272
- */
13273
- focusOn(targets: TCameraTargets, options?: TFocusOnCameraOptions & TCameraAnimationOptions): Promise<any>;
13274
- /**
13275
- * Instantaneously set the camera's transform to be in a new configuration. See also {@link animate}.
13276
- *
13277
- * ```ts
13278
- * const coord = mapView.venue.maps[0].createCoordinate(33.66107, 31.83911);
13279
- *
13280
- * // Place the camera top-down at a specified coordinate
13281
- * mapView.Camera.set({
13282
- * tilt: 0,
13283
- * position: coord,
13284
- * });
13285
- * ```
13286
- *
13287
- * @param transform The new transform of the camera.
13288
- */
13289
- set(transform: TCameraTransform): void;
13290
- /**
13291
- * Convert a Mercator Zoom Level to altitude, which can be used in the Camera APIs
13292
- */
13293
- convertZoomLevelToAltitude(zoomLevel: number): any;
13294
- /**
13295
- * Convert the altitude returned by getZoom into Mercator Zoom level
13296
- */
13297
- convertAltitudeToZoomLevel(altitude: number): any;
13298
- /**
13299
- * Smoothly transition the camera's transform to be in a new configuration. See also {@link set}.
13300
- *
13301
- * ```ts
13302
- * const coord = mapView.venue.maps[0].createCoordinate(33.66107, 31.83911);
13303
- *
13304
- * // Animate the camera to be top-down at a specified coordinate
13305
- * mapView.Camera.animate({
13306
- * tilt: 0,
13307
- * position: coord,
13308
- * });
13309
- * ```
13042
+ export function isGatewayKey(key: string): boolean;
13043
+ export function getCombinedBoundingBox(objects: Object3D[]): Box3;
13044
+ export function getMapsBoundingBox(maps: MapObject[], mapPadding: number): Box3;
13045
+ export function scrubMaterial(material: Material): void;
13046
+ /**
13047
+ * Takes a Mappedin Object or id and returns the ID, so our functions can take bottomRight
13048
+ * @template T extends string | {id: string}
13049
+ * @param {T} object - input can be object containing id or the id itself
13050
+ * @return {string}
13051
+ */
13052
+ export function getObjectId(object: any): string;
13053
+ /**
13054
+ * Takes a Mappedin object or ID and the array to look in and retuns the Object, so our functions can take both
13055
+ */
13056
+ export function getObject<K extends {
13057
+ id: string;
13058
+ }, T extends K | string>(obj: T, array: K[] | undefined): K | undefined;
13059
+ export function getBoundingBox(object: Object3D): Box3;
13060
+ /**
13061
+ * Function pushes the items of the second array onto the first array (inplace).
13062
+ * @template T
13063
+ * @param {Array.<T>} arr1 - base array
13064
+ * @param {Array.<T>} arr2 - array which items will be pushed to arr1
13065
+ */
13066
+ export function appendItems<T>(arr1: T[], arr2: T[]): void;
13067
+ export function getBiggestBoundingBox(objects: Object3D[]): {
13068
+ min: any;
13069
+ max: any;
13070
+ };
13071
+ export function unpackBoundingBox(boundingBox: Box3): Vector3[];
13072
+ export function getMapScale(map: MappedinMap): number;
13073
+ export function getNorth(map: MappedinMap): number;
13074
+ export function flatten(list: any[]): any[];
13075
+ export function uniq(arr: any[]): any[];
13076
+ export function toStyleString(styles: Record<string, string>): string;
13077
+ /**
13078
+ /* getProjectionScaleFactor()
13079
+ /* finds the scale ratio between screen coordinates and 3D coordinates (in X-Z plane)
13080
+ /*
13081
+ * R
13082
+ * /|
13083
+ * C : Camera / |
13084
+ * PQ : Projection Plane / |
13085
+ * OR : Origin / |
13086
+ * F : FOV / |
13087
+ * Q / |
13088
+ * /| |
13089
+ * / | |
13090
+ * / | |
13091
+ * / | |
13092
+ * / | |
13093
+ * / F/2 | |
13094
+ * C ------------P------------ O
13310
13095
  *
13311
- * @param transform The new transform of the camera.
13312
- * @param options
13313
- * @returns a Promise that resolves when the animation finishes, or rejects when it is cancelled.
13314
- */
13315
- animate(transform: TCameraTransform, options?: TCameraAnimationOptions): Promise<undefined>;
13316
- /**
13317
- * Moves the Camera view in a relative direction by a given distance in meters.
13318
13096
  *
13319
- * ```ts
13320
- * // Move the camera 50 meters up relative to the camera frame
13321
- * mapView.Camera.translate(E_CAMERA_DIRECTION.UP, 50);
13322
- * ```
13097
+ * ProjectionScaleFactor = ( OR / PQ )
13098
+ * PQ = canvasHeight / 2
13099
+ * CQ = zoom
13323
13100
  *
13324
- * @returns a Promise that resolves when the translation animation finishes, or rejects when it is cancelled.
13325
- */
13326
- translate(direction: E_CAMERA_DIRECTION, distance: number, options?: TCameraAnimationOptions): Promise<unknown>;
13327
- /**
13328
- * Cancel the currently active Camera animation.
13101
+ * OR / C0 = tan(F/2)
13102
+ * so OR = CO * tan(F/2)
13329
13103
  */
13330
- cancelAnimation(): void;
13104
+ export function getProjectionScaleFactor(FOV: number, canvasHeight: number, zoom: number): number;
13105
+ /** getZoom
13106
+ *
13107
+ * C - Camera, OP -- picture plane (canvas), S - origin,
13108
+ * QR - front side of maps Bounding Box, F: FOV
13109
+ *
13110
+ * Z-axis
13111
+ * R_____|______
13112
+ * /| | |
13113
+ * / | | |
13114
+ * P/ | | | maps BB
13115
+ * /| | | |
13116
+ * / | | | |
13117
+ * / | | | |
13118
+ * / F |E |T |S |
13119
+ * C /--------|-----|-----|-----|------ orthogonal to Y axis, midpoint of focus maps
13120
+ * \ | | | |
13121
+ * \ | | | |
13122
+ * \ | | | |
13123
+ * \ | | | |
13124
+ * \| | | |
13125
+ * O\ | | |
13126
+ * \ | | |
13127
+ * \|_____|_____|
13128
+ * Q
13129
+ *
13130
+ *
13131
+ * We want to get CS, which is the camera zoom
13132
+ *
13133
+ */
13134
+ export function getZoom(focusBox: Box3, focusBoxHeight: number, FOV: number): number;
13135
+ interface CalculateTwoDProjectionsParams {
13136
+ maps: MapObject[];
13137
+ width: number;
13138
+ height: number;
13139
+ camera: Camera;
13331
13140
  }
13141
+ export function calculateTwoDProjections({ maps, width, height, camera }: CalculateTwoDProjectionsParams): {
13142
+ min: {
13143
+ x: number;
13144
+ y: number;
13145
+ };
13146
+ max: {
13147
+ x: number;
13148
+ y: number;
13149
+ };
13150
+ }[];
13151
+ export function splitLine(startNode: Vector3, endNode: Vector3, segments: number): Vector3[];
13152
+ export function isObject(item: any): boolean;
13153
+ export const determineStartingMap: (venue: Mappedin, options: TMapViewOptions) => MappedinMap;
13154
+ export function cyrb53(str: string, seed?: number): number;
13155
+ export function addMarginMultiplierToBoundingBox(bbox: Box3, multiplier: number): Box3;
13156
+ export function tweenPromise({ from, to, duration, easing, delay, onUpdate, onStart, onComplete, }: {
13157
+ from: any;
13158
+ to: any;
13159
+ duration?: number | undefined;
13160
+ easing?: any;
13161
+ delay?: number | undefined;
13162
+ onUpdate?: ((_: any) => void) | undefined;
13163
+ onStart?: (() => void) | undefined;
13164
+ onComplete?: (() => void) | undefined;
13165
+ }): {
13166
+ start(core: any): Promise<void>;
13167
+ };
13168
+ export const linearEase: (t: number) => number;
13169
+ export const quadEaseIn: (t: number) => number;
13170
+ export const quadEaseOut: (t: number) => number;
13171
+ export function interpolate(value: number, inputMin: number, inputMax: number, outputMin: number, outputMax: number, easeFunc?: (t: number) => number): number;
13172
+ export function interpolateMulti(value: number, inputRange: number[], outputRange: number[], easeFunc?: (t: number) => number): number;
13173
+ export function checkWritableBeforeWrite(obj: any, key: string, value: any): void;
13174
+ export {};
13175
+ }
13176
+
13177
+ declare module '@mappedin/mappedin-js/packages/legacy-renderer/internal/utils/browser' {
13178
+ type DeviceType = {
13179
+ isIpad: boolean;
13180
+ isMobile: boolean;
13181
+ isSafari12: boolean;
13182
+ isFirefox: boolean;
13183
+ isWindows: boolean;
13184
+ };
13185
+ /**
13186
+ * Get device OS info
13187
+ * export for testing purpose
13188
+ * @returns DeviceType
13189
+ */
13190
+ export const _deviceTypeControl: {
13191
+ getDeviceType(): DeviceType;
13192
+ _reset(): void;
13193
+ };
13194
+ export const getDeviceType: () => DeviceType;
13195
+ /**
13196
+ * Creates a closure encapsulating the logic of getting device GPU info.
13197
+ * inspired by https://github.com/pmndrs/detect-gpu
13198
+ * export for testing
13199
+ */
13200
+ export const _gpuInfoControl: {
13201
+ getInfo: () => string | undefined;
13202
+ shouldDisableOffscreenCanvas: () => boolean;
13203
+ _setCanvas(c: HTMLCanvasElement): void;
13204
+ };
13205
+ export const getGPUInfo: () => string | undefined;
13206
+ /**
13207
+ * Check if device is certain intel integrated GPU.
13208
+ * This is for implementing workaround - https://issues.chromium.org/issues/40251953
13209
+ * The reason we want to disable OffscreenCanvas at all is due to `willReadFrequently` flag only works in FF.
13210
+ * In order to ensure the integrated intel GPU render text correctly
13211
+ */
13212
+ export const shouldDisableOffscreenCanvas: () => boolean;
13213
+ export {};
13214
+ }
13215
+
13216
+ declare module '@mappedin/mappedin-js/packages/legacy-renderer/internal/utils/async' {
13217
+ export function throttle<T>(func: () => void, wait: number, options?: any): () => void;
13218
+ export function debounce<T>(func: () => void, wait: number, immediate?: boolean): () => void;
13332
13219
  }
13333
13220
 
13334
13221
  declare module '@mappedin/mappedin-js/packages/legacy-renderer/internal/Mappedin.MultiFloorView' {
@@ -13924,6 +13811,244 @@ declare module '@mappedin/mappedin-js/packages/legacy-renderer/public/api/BlueDo
13924
13811
  }
13925
13812
  }
13926
13813
 
13814
+ declare module '@mappedin/mappedin-js/packages/legacy-renderer/public/api/Camera' {
13815
+ import { E_CAMERA_DIRECTION } from '@mappedin/mappedin-js/packages/legacy-renderer/MapView.enums';
13816
+ import CameraController, { TCameraAnimationOptions, TCameraInteractionsSetOptions, TCameraTargets, TCameraTransform, TFocusOnCameraOptions } from '@mappedin/mappedin-js/packages/legacy-renderer/private/controllers/CameraController';
13817
+ /**
13818
+ * API to control and respond to the state of the camera within the scene.
13819
+ */
13820
+ export class Camera {
13821
+ #private;
13822
+ /**
13823
+ * @hidden
13824
+ */
13825
+ constructor(controller: CameraController);
13826
+ /**
13827
+ * Subscribe a function to be called when an {@link E_CAMERA_EVENT} is fired.
13828
+ *
13829
+ * ```ts
13830
+ * const cameraChangedHandler = ({ tilt, position, zoom, rotation }) => {
13831
+ * // Do something with the new values
13832
+ * };
13833
+ * mapView.Camera.on(E_CAMERA_EVENT.CHANGED, cameraChangedHandler);
13834
+ * ```
13835
+ *
13836
+ * @param eventName An {@link E_CAMERA_EVENT} that is fired when the camera changes.
13837
+ * @param fn A callback that gets called when the corresponding event is fired. The
13838
+ * callback will get passed an argument with a type that's one of {@link CAMERA_EVENT_PAYLOAD}.
13839
+ */
13840
+ on: CameraController['on'];
13841
+ /**
13842
+ * Unsubscribe a function that was previously subscribed with {@link on}.
13843
+ *
13844
+ * ```ts
13845
+ * mapView.Camera.on(E_CAMERA_EVENT.CHANGED, cameraChangedHandler);
13846
+ *
13847
+ * ...
13848
+ *
13849
+ * // Something changed and I no longer want this event to fire
13850
+ * mapView.Camera.off(E_CAMERA_EVENT.CHANGED, cameraChangedHandler);
13851
+ * ```
13852
+ *
13853
+ * @param eventName An {@link E_CAMERA_EVENT} that is fired when the camera changes.
13854
+ * @param fn A function that was previously passed to {@link on}. The function must
13855
+ * have the same reference as the function that was subscribed.
13856
+ */
13857
+ off: CameraController['off'];
13858
+ /**
13859
+ * The current camera animation, if any. Resolves when the animation finishes.
13860
+ */
13861
+ get currentAnimation(): Promise<undefined> | undefined;
13862
+ /**
13863
+ * Current Camera zoom (in meters)
13864
+ */
13865
+ get zoom(): number;
13866
+ /**
13867
+ * Current Camera rotation (in radians) from north
13868
+ */
13869
+ get rotation(): number;
13870
+ /**
13871
+ * Current camera tilt angle (in radians), relative to a top-down view.
13872
+ *
13873
+ * ex: 0 means the camera is facing top-down, π/2 means the camera is
13874
+ * facing directly from the side.
13875
+ */
13876
+ get tilt(): number;
13877
+ /**
13878
+ * Get the minimum distance (in meters) the camera is allowed to get to the ground.
13879
+ */
13880
+ get minZoom(): number;
13881
+ /**
13882
+ * Set the minimum distance (in meters) the camera is allowed to get to the ground.
13883
+ */
13884
+ set minZoom(meters: number);
13885
+ /**
13886
+ * Get the maximum distance (in meters) the camera is allowed to get from the ground.
13887
+ */
13888
+ get maxZoom(): number;
13889
+ /**
13890
+ * Set the maximum distance (in meters) the camera is allowed to get from the ground.
13891
+ */
13892
+ set maxZoom(meters: number);
13893
+ /**
13894
+ * Get the current maximum tilt angle (in radians) the camera is allowed to use.
13895
+ */
13896
+ get maxTilt(): number;
13897
+ /**
13898
+ * Sets the maximum tilt angle (in radians) the camera is allowed to use.
13899
+ *
13900
+ * Tilt angle must be between 0 and π/2 radians. It will be clamped within
13901
+ * this range if it exceeds it on either end.
13902
+ *
13903
+ * As tilt angle approaches π/2 radians, this will impact overall touch controls
13904
+ * and should be used sparingly.
13905
+ */
13906
+ set maxTilt(radians: number);
13907
+ /**
13908
+ * Get the current camera position, which is at the center of the map.
13909
+ * @returns the position as a coordinate
13910
+ */
13911
+ get position(): import("../../index.rn").MappedinCoordinate;
13912
+ /**
13913
+ * Enable or disable the ability for the user to interact with the camera (e.g. pan, zoom, tilt, etc).
13914
+ * This does not affect programmatic camera controls, such as {@link set} and {@link focusOn}.
13915
+ *
13916
+ * ```ts
13917
+ * // The user can no longer interact to move the camera
13918
+ * mapView.Camera.interactions.disable();
13919
+ *
13920
+ * // The user can now interact to move the camera again
13921
+ * mapView.Camera.interactions.enable();
13922
+ * ```
13923
+ */
13924
+ interactions: {
13925
+ /**
13926
+ * Enable or disable specific user interactions.
13927
+ *
13928
+ * ```ts
13929
+ * mapView.Camera.interactions.set({ zoom: false });
13930
+ * ```
13931
+ *
13932
+ * @param options An object defining the interactions to switch on or off.
13933
+ *
13934
+ */
13935
+ set: (options: TCameraInteractionsSetOptions) => void;
13936
+ /**
13937
+ * Enable all user interactions.
13938
+ */
13939
+ enable: () => void;
13940
+ /**
13941
+ * Disable all user interactions.
13942
+ */
13943
+ disable: () => void;
13944
+ };
13945
+ /**
13946
+ * Define an area of the screen that is safe for the camera. Anything outside the safe area is
13947
+ * assumed to be covered in some way (e.g. by UI) meaning the camera will not place
13948
+ * any map elements there when calling {@link focusOn}.
13949
+ *
13950
+ * ```ts
13951
+ * // The top 100px of the canvas are covered by a UI element
13952
+ * mapView.Camera.setSafeAreaInsets({ top: 100, left: 0, bottom: 0, right: 0});
13953
+ * mapView.Camera.focusOn({ nodes });
13954
+ * ```
13955
+ *
13956
+ * @param insets An object defining a number of pixels from the top, left, bottom, and right of
13957
+ * the screen. Only the area within the padding defined by these pixels is considered safe.
13958
+ */
13959
+ setSafeAreaInsets(insets: {
13960
+ top: number;
13961
+ left: number;
13962
+ bottom: number;
13963
+ right: number;
13964
+ }): void;
13965
+ /**
13966
+ * Retrieve the values previously set by {@link setSafeAreaInsets}.
13967
+ *
13968
+ * @returns An object defining a number of pixels from the top, left, bottom, and right of
13969
+ * the screen.
13970
+ */
13971
+ getSafeAreaInsets(): import("../../MapView.types").TPadding;
13972
+ /**
13973
+ * Animate the camera to focus on a collection of targets. To control where the targets should
13974
+ * be placed on screen, either specify `safeAreaInsets` on the {@link TFocusOnCameraOptions}
13975
+ * or call {@link setSafeAreaInsets}.
13976
+ *
13977
+ * ```ts
13978
+ * const location = mapView.venue.locations.find((l) => l.name === "My Location")!;
13979
+ *
13980
+ * mapView.Camera.focusOn({
13981
+ * polygons: location.polygons,
13982
+ * nodes: location.nodes,
13983
+ * });
13984
+ * ```
13985
+ *
13986
+ * @param targets A collection of things that the camera will place into view at the end of the
13987
+ * animation.
13988
+ * @param options
13989
+ * @returns a Promise that resolves when the animation finishes, or rejects when it is cancelled.
13990
+ */
13991
+ focusOn(targets: TCameraTargets, options?: TFocusOnCameraOptions & TCameraAnimationOptions): Promise<any>;
13992
+ /**
13993
+ * Instantaneously set the camera's transform to be in a new configuration. See also {@link animate}.
13994
+ *
13995
+ * ```ts
13996
+ * const coord = mapView.venue.maps[0].createCoordinate(33.66107, 31.83911);
13997
+ *
13998
+ * // Place the camera top-down at a specified coordinate
13999
+ * mapView.Camera.set({
14000
+ * tilt: 0,
14001
+ * position: coord,
14002
+ * });
14003
+ * ```
14004
+ *
14005
+ * @param transform The new transform of the camera.
14006
+ */
14007
+ set(transform: TCameraTransform): void;
14008
+ /**
14009
+ * Convert a Mercator Zoom Level to altitude, which can be used in the Camera APIs
14010
+ */
14011
+ convertZoomLevelToAltitude(zoomLevel: number): any;
14012
+ /**
14013
+ * Convert the altitude returned by getZoom into Mercator Zoom level
14014
+ */
14015
+ convertAltitudeToZoomLevel(altitude: number): any;
14016
+ /**
14017
+ * Smoothly transition the camera's transform to be in a new configuration. See also {@link set}.
14018
+ *
14019
+ * ```ts
14020
+ * const coord = mapView.venue.maps[0].createCoordinate(33.66107, 31.83911);
14021
+ *
14022
+ * // Animate the camera to be top-down at a specified coordinate
14023
+ * mapView.Camera.animate({
14024
+ * tilt: 0,
14025
+ * position: coord,
14026
+ * });
14027
+ * ```
14028
+ *
14029
+ * @param transform The new transform of the camera.
14030
+ * @param options
14031
+ * @returns a Promise that resolves when the animation finishes, or rejects when it is cancelled.
14032
+ */
14033
+ animate(transform: TCameraTransform, options?: TCameraAnimationOptions): Promise<undefined>;
14034
+ /**
14035
+ * Moves the Camera view in a relative direction by a given distance in meters.
14036
+ *
14037
+ * ```ts
14038
+ * // Move the camera 50 meters up relative to the camera frame
14039
+ * mapView.Camera.translate(E_CAMERA_DIRECTION.UP, 50);
14040
+ * ```
14041
+ *
14042
+ * @returns a Promise that resolves when the translation animation finishes, or rejects when it is cancelled.
14043
+ */
14044
+ translate(direction: E_CAMERA_DIRECTION, distance: number, options?: TCameraAnimationOptions): Promise<unknown>;
14045
+ /**
14046
+ * Cancel the currently active Camera animation.
14047
+ */
14048
+ cancelAnimation(): void;
14049
+ }
14050
+ }
14051
+
13927
14052
  declare module '@mappedin/mappedin-js/packages/legacy-renderer/public/api/Exporter' {
13928
14053
  import { ExportController } from '@mappedin/mappedin-js/packages/legacy-renderer/internal';
13929
14054
  /**