@mappedin/mappedin-js 5.29.4 → 5.30.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.
@@ -766,7 +766,7 @@ declare module '@mappedin/mappedin-js/renderer/public/MapView' {
766
766
  }
767
767
 
768
768
  declare module '@mappedin/mappedin-js/get-venue' {
769
- import type { TGetVenueOptions, TGetVenueOptionsInternal, TVenueMetadata } from '@mappedin/mappedin-js/get-venue/Mappedin.types';
769
+ import type { TAllGetVenueOptions, TGetVenueOptions, TGetVenueOptionsInternal, TVenueMetadata } from '@mappedin/mappedin-js/get-venue/Mappedin.types';
770
770
  import { Mappedin } from '@mappedin/mappedin-js/get-venue/Mappedin';
771
771
  import { defaultThings } from '@mappedin/mappedin-js/get-venue/default-things';
772
772
  import { GET_VENUE_EVENT } from '@mappedin/mappedin-js/get-venue/internal';
@@ -813,7 +813,10 @@ declare module '@mappedin/mappedin-js/get-venue' {
813
813
  import { MAP_RENDER_MODE } from '@mappedin/mappedin-js/get-venue/Mappedin.types';
814
814
  import { ParsedMVF } from '@mappedin/mvf';
815
815
  export { MAP_RENDER_MODE, GET_VENUE_EVENT };
816
- export function parseOptions(options: TGetVenueOptions): TGetVenueOptionsInternal & TGetVenueOptions;
816
+ /**
817
+ * @internal
818
+ */
819
+ export function parseOptions<T extends TAllGetVenueOptions>(options: T): TGetVenueOptionsInternal<T>;
817
820
  /**
818
821
  * @internal
819
822
  */
@@ -915,7 +918,7 @@ declare module '@mappedin/mappedin-js/get-venue' {
915
918
  * Download a bundle and return a Mappedin instance
916
919
  * @internal
917
920
  */
918
- export function downloadBundle(userOptions: any, { url, updated_at }: {
921
+ export function downloadBundle(userOptions: TGetVenueBundleOptions, { url, updated_at }: {
919
922
  url: any;
920
923
  updated_at: any;
921
924
  }): Promise<Mappedin>;
@@ -1139,7 +1142,7 @@ declare module '@mappedin/mappedin-js/renderer/MapView.types' {
1139
1142
  import type { Path } from '@mappedin/mappedin-js/renderer/private/controllers/PathsController';
1140
1143
  import { TOOLTIP_ANCHOR } from '@mappedin/mappedin-js/renderer/internal/Mappedin.SmartTooltip';
1141
1144
  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/renderer/MapView.enums';
1142
- import { TOutdoorViewControllerOptions } from '@mappedin/mappedin-js/renderer/private/controllers/OutdoorViewController';
1145
+ import { TOutdoorViewOptions, TOutdoorViewOptionsWithHeaders, TOutdoorViewOptionsWithAuthURL } from '@mappedin/mappedin-js/renderer/private/controllers/OutdoorViewController';
1143
1146
  export type { TEnableBlueDotOptions, TFloatingLabelAppearance };
1144
1147
  /** @internal */
1145
1148
  export type Without<T, U> = {
@@ -1647,7 +1650,7 @@ declare module '@mappedin/mappedin-js/renderer/MapView.types' {
1647
1650
  * Requires `multiBufferRendering` to be enabled.
1648
1651
  * @experimental
1649
1652
  */
1650
- outdoorView?: TOutdoorViewControllerOptions & {
1653
+ outdoorView?: TOutdoorViewOptions & {
1651
1654
  enabled?: boolean;
1652
1655
  };
1653
1656
  /**
@@ -1845,7 +1848,7 @@ declare module '@mappedin/mappedin-js/renderer/MapView.types' {
1845
1848
  * @experimental
1846
1849
  * Enable outdoor view. Requires multi-buffer rendering to be enabled
1847
1850
  */
1848
- outdoorView?: TOutdoorViewControllerOptions & {
1851
+ outdoorView?: TOutdoorViewOptions & {
1849
1852
  enabled?: boolean;
1850
1853
  };
1851
1854
  /**
@@ -2350,6 +2353,7 @@ declare module '@mappedin/mappedin-js/renderer/MapView.types' {
2350
2353
  */
2351
2354
  [E_CAMERA_EVENT.TILT_CHANGED]: number;
2352
2355
  };
2356
+ export type { TOutdoorViewOptions, TOutdoorViewOptionsWithHeaders, TOutdoorViewOptionsWithAuthURL };
2353
2357
  export type { default as BlueDotController } from '@mappedin/mappedin-js/renderer/private/controllers/BlueDotController';
2354
2358
  export type { default as Journey } from '@mappedin/mappedin-js/renderer/public/api/Journey';
2355
2359
  }
@@ -4762,6 +4766,14 @@ declare module '@mappedin/mappedin-js/renderer/public/api/Exporter' {
4762
4766
  }
4763
4767
 
4764
4768
  declare module '@mappedin/mappedin-js/get-venue/Mappedin.types' {
4769
+ import type { TGetVenueMVFOptions, TGetVenueMakerOptions } from '@mappedin/mappedin-js/get-venue';
4770
+ import type { DefaultThings } from '@mappedin/mappedin-js/get-venue/default-things';
4771
+ export type MergedThings = {
4772
+ [key in keyof DefaultThings]: string[];
4773
+ } & {
4774
+ [k: string]: string[];
4775
+ };
4776
+ export type ThingsOption = Partial<MergedThings>;
4765
4777
  export type TGetVenueOptions = {
4766
4778
  accessToken?: string;
4767
4779
  clientId?: string;
@@ -4775,22 +4787,44 @@ declare module '@mappedin/mappedin-js/get-venue/Mappedin.types' {
4775
4787
  [key in string]: string;
4776
4788
  };
4777
4789
  venue: string;
4778
- things?: any;
4790
+ /**
4791
+ * An object specifying additional properties to fetch for each data item.
4792
+ * Each key represents a data item (e.g., 'locations', 'nodes'), and the value is an array of strings indicating extra properties to be included.
4793
+ * @example
4794
+ * For example:
4795
+ * ```
4796
+ * getVenue({
4797
+ * venue: 'some-venue',
4798
+ * things: { vortexes: [ 'material' ]
4799
+ * }})
4800
+ * ```
4801
+ */
4802
+ things?: ThingsOption;
4779
4803
  useDraftData?: boolean;
4780
4804
  platformString?: string;
4781
4805
  emitAnalyticsEvents?: boolean;
4782
4806
  secure?: boolean;
4783
4807
  preloadMapGeometry?: boolean;
4784
4808
  };
4785
- export type TGetVenueOptionsInternal = {
4809
+ export type TProcessedMVFOptions = TGetVenueMakerOptions & {
4810
+ emitAnalyticsEvents: boolean;
4811
+ clientId: string;
4812
+ clientSecret: string;
4813
+ venue: string;
4814
+ };
4815
+ export type TAllGetVenueOptions = TGetVenueOptions | TGetVenueMVFOptions | (TProcessedMVFOptions & {
4816
+ perspective?: string;
4817
+ });
4818
+ export type TGetVenueOptionsInternal<T extends TAllGetVenueOptions> = Omit<T & {
4786
4819
  baseUrl?: string;
4787
4820
  supplementaryUrl?: string;
4788
4821
  noAuth?: boolean;
4789
4822
  includeHidden?: boolean;
4790
4823
  apiGateway?: string;
4791
4824
  authorization?: string;
4792
- things?: any;
4793
4825
  headers?: any;
4826
+ }, 'things'> & {
4827
+ things?: MergedThings;
4794
4828
  };
4795
4829
  export type TVenueMetadata = {
4796
4830
  languages: {
@@ -4813,14 +4847,14 @@ declare module '@mappedin/mappedin-js/get-venue/Mappedin.types' {
4813
4847
 
4814
4848
  declare module '@mappedin/mappedin-js/get-venue/Mappedin' {
4815
4849
  import { Navigator } from '@mappedin/mappedin-js/navigator';
4816
- import type { TGetVenueOptions, TGetVenueOptionsInternal } from '@mappedin/mappedin-js/get-venue/Mappedin.types';
4850
+ import type { TAllGetVenueOptions, TGetVenueOptions, TGetVenueOptionsInternal } from '@mappedin/mappedin-js/get-venue/Mappedin.types';
4817
4851
  import type { MappedinNode, MappedinPolygon, MappedinLocation, MappedinCategory, MappedinVortex, MappedinVenue, MappedinTheme, MappedinRankings, MappedinLocationRankings, MappedinEvent, MappedinLocationState, MappedinMap, MappedinMapGroup, GET_VENUE_PAYLOAD } from '@mappedin/mappedin-js/get-venue/internal';
4818
4852
  import { TAccessors, GET_VENUE_EVENT } from '@mappedin/mappedin-js/get-venue/internal';
4819
4853
  import { IAnalytics } from '@mappedin/mappedin-js/get-venue/Mappedin.CustomerAnalytics';
4820
4854
  import { ParsedMVF } from '@mappedin/mvf';
4821
4855
  import { ParsedMVFv1 } from '@mappedin/mappedin-js/get-venue/Mappedin.MVF.types';
4822
4856
  import { PubSub } from '@mappedin/mappedin-js/get-venue/pub-sub.typed';
4823
- export const defaultOptions: TGetVenueOptionsInternal & TGetVenueOptions;
4857
+ export const defaultOptions: TGetVenueOptionsInternal<TGetVenueOptions>;
4824
4858
  export class Mappedin extends PubSub<GET_VENUE_PAYLOAD, GET_VENUE_EVENT> {
4825
4859
  #private;
4826
4860
  perspective: any;
@@ -5052,7 +5086,7 @@ declare module '@mappedin/mappedin-js/get-venue/Mappedin' {
5052
5086
  /**
5053
5087
  * @deprecated Use {@link hydrateVenue} instead
5054
5088
  */
5055
- constructor(options: TGetVenueOptionsInternal & TGetVenueOptions);
5089
+ constructor(options: TGetVenueOptionsInternal<TAllGetVenueOptions>);
5056
5090
  analytics: IAnalytics;
5057
5091
  /**
5058
5092
  * @hidden
@@ -5082,6 +5116,7 @@ declare module '@mappedin/mappedin-js/get-venue/default-things' {
5082
5116
  themes: string[];
5083
5117
  rankings: string[];
5084
5118
  };
5119
+ export type DefaultThings = typeof defaultThings;
5085
5120
  }
5086
5121
 
5087
5122
  declare module '@mappedin/mappedin-js/get-venue/internal' {
@@ -5353,6 +5388,7 @@ declare module '@mappedin/mappedin-js/get-venue/MappedinLocation' {
5353
5388
  siblingGroups?: TSiblingGroup[] | undefined;
5354
5389
  gallery?: TGalleryImage[] | undefined;
5355
5390
  amenity?: string | undefined;
5391
+ filterFlags?: string[];
5356
5392
  constructor(mappedin: Mappedin, data: any);
5357
5393
  /**
5358
5394
  * Polygons this Location is attached to.
@@ -6232,45 +6268,97 @@ declare module '@mappedin/mappedin-js/renderer/private/controllers/OutdoorViewCo
6232
6268
  import './OutdoorViewController.scss';
6233
6269
  import type { ICore } from '@mappedin/mappedin-js/renderer/internal';
6234
6270
  import { XOR } from '@mappedin/mappedin-js/renderer/MapView.types';
6271
+ /**
6272
+ * Represents the possible positions for map attribution.
6273
+ */
6235
6274
  export type TAttributionPosition = 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right';
6236
- export type TOutdoorViewControllerOptionsWithHeaders = {
6237
- url?: string;
6238
- attributionPosition?: TAttributionPosition;
6239
- customAttribution?: string | string[];
6240
- headers: {
6241
- [key: string]: string | null;
6242
- };
6275
+ /**
6276
+ * Defines the options for an Outdoor View when initialized with headers for authentication.
6277
+ */
6278
+ export type TOutdoorViewOptionsWithHeaders = {
6279
+ /**
6280
+ * The URL to the map style file.
6281
+ * @see https://github.com/maplibre/maplibre-style-spec/
6282
+ */
6283
+ url?: string;
6284
+ /**
6285
+ * The position on the map where the attribution should be displayed.
6286
+ * @default 'bottom-right'
6287
+ */
6288
+ attributionPosition?: 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right';
6289
+ /**
6290
+ * Custom text or an array of texts to be used for the map attribution.
6291
+ */
6292
+ customAttribution?: string | string[];
6293
+ /**
6294
+ * An object containing HTTP headers for authentication purposes.
6295
+ * */
6296
+ headers: {
6297
+ [key: string]: string | null;
6298
+ };
6243
6299
  };
6244
- export type TOutdoorViewControllerOptionsWithAuthURL = {
6245
- url?: string;
6246
- authURL?: string;
6247
- customAttribution?: string | string[];
6248
- attributionPosition?: TAttributionPosition;
6300
+ /**
6301
+ * Defines the options for an Outdoor View when initialized with a URL for authentication.
6302
+ */
6303
+ export type TOutdoorViewOptionsWithAuthURL = {
6304
+ /**
6305
+ * The URL to the map style file.
6306
+ * @see https://github.com/maplibre/maplibre-style-spec/
6307
+ */
6308
+ url?: string;
6309
+ /**
6310
+ * The URL to obtain an authentication token.
6311
+ */
6312
+ authURL?: string;
6313
+ /**
6314
+ * Custom text or an array of texts to be used for the map attribution.
6315
+ */
6316
+ customAttribution?: string | string[];
6317
+ /**
6318
+ * The position on the map where the attribution should be displayed.
6319
+ * @default 'bottom-right'
6320
+ */
6321
+ attributionPosition?: 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right';
6249
6322
  };
6250
- export type TOutdoorViewControllerOptions = XOR<TOutdoorViewControllerOptionsWithHeaders, TOutdoorViewControllerOptionsWithAuthURL>;
6323
+ /**
6324
+ * Defines the options for initializing an Outdoor View.
6325
+ * This is a union type that requires exclusive or logic,
6326
+ * ensuring that an instance can either have headers or
6327
+ * an authentication URL, but not both.
6328
+ *
6329
+ * Note: It isn't permitted to use `.headers` and `.authURL` options simultaneously.
6330
+ *
6331
+ * @property {string} [url] - The URL to the map style file.
6332
+ * @property {TAttributionPosition} [attributionPosition='bottom-right'] - The position on the map where the attribution should be displayed.
6333
+ * @property {string | string[]} [customAttribution] - Custom text or an array of texts to be used for the map attribution.
6334
+ * @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.
6335
+ * @property {string} [authURL] - The URL to obtain an authentication token. It isn't permitted to use `.headers` and `.authURL` options simultaneously.
6336
+ * @interface
6337
+ */
6338
+ export type TOutdoorViewOptions = XOR<TOutdoorViewOptionsWithHeaders, TOutdoorViewOptionsWithAuthURL>;
6251
6339
  class OutdoorViewController {
6252
- _attribution: any;
6253
- core: ICore;
6254
- map: any;
6255
- enabled: boolean;
6256
- hidden: boolean;
6257
- url: string;
6258
- authURL: string;
6259
- headers?: TOutdoorViewControllerOptions['headers'];
6260
- customAttribution?: string | string[];
6261
- attributionPosition?: TAttributionPosition;
6262
- loaded: boolean;
6263
- constructor(core: ICore, options?: TOutdoorViewControllerOptions);
6264
- module: any;
6265
- load(): Promise<void>;
6266
- get attributions(): any;
6267
- hide(): void;
6268
- show(): void;
6269
- resize(): void;
6270
- getRequestHeaders: () => Promise<TOutdoorViewControllerOptions['headers']>;
6271
- render(): void;
6272
- setStyle(style: any): void;
6273
- setAttributionPosition(position: TAttributionPosition): void;
6340
+ _attribution: any;
6341
+ core: ICore;
6342
+ map: any;
6343
+ enabled: boolean;
6344
+ hidden: boolean;
6345
+ url: string;
6346
+ authURL: string;
6347
+ headers?: TOutdoorViewOptions['headers'];
6348
+ customAttribution?: string | string[];
6349
+ attributionPosition?: TAttributionPosition;
6350
+ loaded: boolean;
6351
+ constructor(core: ICore, options?: TOutdoorViewOptions);
6352
+ module: any;
6353
+ load(): Promise<void>;
6354
+ get attributions(): any;
6355
+ hide(): void;
6356
+ show(): void;
6357
+ resize(): void;
6358
+ getRequestHeaders: () => Promise<TOutdoorViewOptions['headers']>;
6359
+ render(): void;
6360
+ setStyle(style: any): void;
6361
+ setAttributionPosition(position: TAttributionPosition): void;
6274
6362
  }
6275
6363
  export default OutdoorViewController;
6276
6364
  }
@@ -8131,6 +8219,17 @@ declare module '@mappedin/mappedin-js/renderer/internal/Mappedin.Element' {
8131
8219
  assetManager: AssetManager;
8132
8220
  imageVisible: boolean;
8133
8221
  labelVisible: boolean;
8222
+ polygonHeight: number;
8223
+ geometry: ExtrudeGeometry;
8224
+ mesh: Mesh;
8225
+ material: MeshLambertMaterial | MeshLambertMaterial[];
8226
+ labelMesh?: Mesh;
8227
+ imageMesh?: Mesh;
8228
+ /**
8229
+ * 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
8230
+ */
8231
+ isInflated: boolean;
8232
+ sortScore: number | null;
8134
8233
  boundingBox: {
8135
8234
  min: {
8136
8235
  x: number;
@@ -8143,13 +8242,6 @@ declare module '@mappedin/mappedin-js/renderer/internal/Mappedin.Element' {
8143
8242
  z: number;
8144
8243
  };
8145
8244
  };
8146
- polygonHeight: number;
8147
- geometry: ExtrudeGeometry;
8148
- mesh: Mesh;
8149
- material: MeshLambertMaterial | MeshLambertMaterial[];
8150
- labelMesh?: Mesh;
8151
- imageMesh?: Mesh;
8152
- sortScore: number | null;
8153
8245
  static materials: {
8154
8246
  [key in string]: MeshLambertMaterial | MeshLambertMaterial[];
8155
8247
  };
@@ -8165,7 +8257,8 @@ declare module '@mappedin/mappedin-js/renderer/internal/Mappedin.Element' {
8165
8257
  x: number;
8166
8258
  y: number;
8167
8259
  };
8168
- static _makeFromCoords(className: any, coords: any, mapClass: any): any;
8260
+ static _makeFromCoords(className: any, coords: any, mapClass: any, element: any): any;
8261
+ static _inflate(coords: any, width: any): any;
8169
8262
  static _setPolygonDefaults(poly: any): any;
8170
8263
  constructor(poly: MappedinPolygon, mapClass: MappedinMap, container: Group, assetManager: any, mapLoadingStrategy?: MAP_RENDER_MODE);
8171
8264
  getBoundingBox(): {
@@ -9289,158 +9382,9 @@ declare module '@mappedin/mappedin-js/renderer/internal/Mappedin.BlueDot/Mappedi
9289
9382
  }
9290
9383
 
9291
9384
  declare module '@mappedin/mappedin-js/renderer/internal/utils' {
9292
- import { Box3, Vector3, Object3D, Material } from 'three';
9293
- import { Mappedin, MapObject, MappedinMap, TMapViewOptions } from '@mappedin/mappedin-js/renderer/internal';
9294
- import { Camera } from '@mappedin/mappedin-js/renderer/public/api/Camera';
9295
- /**
9296
- * Utils function listing
9297
- *
9298
- * - scrubMaterial
9299
- * - getObjectID
9300
- * - getObject
9301
- * - getBoundingBox
9302
- * - getBiggestBoundingBox
9303
- * - upackBoundingBox
9304
- * - getMapScale
9305
- * - throttle -> taken from lodash.js
9306
- * - getProjectionScaleFactor
9307
- * - getZoom
9308
- */
9309
- export function isGatewayKey(key: string): boolean;
9310
- export function getCombinedBoundingBox(objects: Object3D[]): Box3;
9311
- export function getMapsBoundingBox(maps: MapObject[], mapPadding: number): Box3;
9312
- export function scrubMaterial(material: Material): void;
9313
- /**
9314
- * Takes a Mappedin Object or id and returns the ID, so our functions can take bottomRight
9315
- * @template T extends string | {id: string}
9316
- * @param {T} object - input can be object containing id or the id itself
9317
- * @return {string}
9318
- */
9319
- export function getObjectId(object: any): string;
9320
- /**
9321
- * Takes a Mappedin object or ID and the array to look in and retuns the Object, so our functions can take both
9322
- */
9323
- export function getObject<K extends {
9324
- id: string;
9325
- }, T extends K | string>(obj: T, array: K[] | undefined): K | undefined;
9326
- export function getBoundingBox(object: Object3D): Box3;
9327
- /**
9328
- * Function pushes the items of the second array onto the first array (inplace).
9329
- * @template T
9330
- * @param {Array.<T>} arr1 - base array
9331
- * @param {Array.<T>} arr2 - array which items will be pushed to arr1
9332
- */
9333
- export function appendItems<T>(arr1: T[], arr2: T[]): void;
9334
- export function getBiggestBoundingBox(objects: Object3D[]): {
9335
- min: any;
9336
- max: any;
9337
- };
9338
- export function unpackBoundingBox(boundingBox: Box3): Vector3[];
9339
- export function getMapScale(map: MappedinMap): number;
9340
- export function getNorth(map: MappedinMap): number;
9341
- export function throttle<T>(func: () => void, wait: number, options?: any): () => void;
9342
- export function debounce<T>(func: () => void, wait: number, immediate?: boolean): () => void;
9343
- export function flatten(list: any[]): any[];
9344
- export function uniq(arr: any[]): any[];
9345
- export function toStyleString(styles: Record<string, string>): string;
9346
- /**
9347
- /* getProjectionScaleFactor()
9348
- /* finds the scale ratio between screen coordinates and 3D coordinates (in X-Z plane)
9349
- /*
9350
- * R
9351
- * /|
9352
- * C : Camera / |
9353
- * PQ : Projection Plane / |
9354
- * OR : Origin / |
9355
- * F : FOV / |
9356
- * Q / |
9357
- * /| |
9358
- * / | |
9359
- * / | |
9360
- * / | |
9361
- * / | |
9362
- * / F/2 | |
9363
- * C ------------P------------ O
9364
- *
9365
- *
9366
- * ProjectionScaleFactor = ( OR / PQ )
9367
- * PQ = canvasHeight / 2
9368
- * CQ = zoom
9369
- *
9370
- * OR / C0 = tan(F/2)
9371
- * so OR = CO * tan(F/2)
9372
- */
9373
- export function getProjectionScaleFactor(FOV: number, canvasHeight: number, zoom: number): number;
9374
- /** getZoom
9375
- *
9376
- * C - Camera, OP -- picture plane (canvas), S - origin,
9377
- * QR - front side of maps Bounding Box, F: FOV
9378
- *
9379
- * Z-axis
9380
- * R_____|______
9381
- * /| | |
9382
- * / | | |
9383
- * P/ | | | maps BB
9384
- * /| | | |
9385
- * / | | | |
9386
- * / | | | |
9387
- * / F |E |T |S |
9388
- * C /--------|-----|-----|-----|------ orthogonal to Y axis, midpoint of focus maps
9389
- * \ | | | |
9390
- * \ | | | |
9391
- * \ | | | |
9392
- * \ | | | |
9393
- * \| | | |
9394
- * O\ | | |
9395
- * \ | | |
9396
- * \|_____|_____|
9397
- * Q
9398
- *
9399
- *
9400
- * We want to get CS, which is the camera zoom
9401
- *
9402
- */
9403
- export function getZoom(focusBox: Box3, focusBoxHeight: number, FOV: number): number;
9404
- interface CalculateTwoDProjectionsParams {
9405
- maps: MapObject[];
9406
- width: number;
9407
- height: number;
9408
- camera: Camera;
9409
- }
9410
- export function calculateTwoDProjections({ maps, width, height, camera }: CalculateTwoDProjectionsParams): {
9411
- min: {
9412
- x: number;
9413
- y: number;
9414
- };
9415
- max: {
9416
- x: number;
9417
- y: number;
9418
- };
9419
- }[];
9420
- export function splitLine(startNode: Vector3, endNode: Vector3, segments: number): Vector3[];
9421
- export function isObject(item: any): boolean;
9422
- export const determineStartingMap: (venue: Mappedin, options: TMapViewOptions) => MappedinMap;
9423
- export function cyrb53(str: string, seed?: number): number;
9424
- export function addMarginMultiplierToBoundingBox(bbox: Box3, multiplier: number): Box3;
9425
- export function tweenPromise({ from, to, duration, easing, delay, onUpdate, onStart, onComplete, }: {
9426
- from: any;
9427
- to: any;
9428
- duration?: number | undefined;
9429
- easing?: any;
9430
- delay?: number | undefined;
9431
- onUpdate?: ((_: any) => void) | undefined;
9432
- onStart?: (() => void) | undefined;
9433
- onComplete?: (() => void) | undefined;
9434
- }): {
9435
- start(core: any): Promise<void>;
9436
- };
9437
- export const linearEase: (t: number) => number;
9438
- export const quadEaseIn: (t: number) => number;
9439
- export const quadEaseOut: (t: number) => number;
9440
- export function interpolate(value: number, inputMin: number, inputMax: number, outputMin: number, outputMax: number, easeFunc?: (t: number) => number): number;
9441
- export function interpolateMulti(value: number, inputRange: number[], outputRange: number[], easeFunc?: (t: number) => number): number;
9442
- export function checkWritableBeforeWrite(obj: any, key: string, value: any): void;
9443
- export {};
9385
+ export * from '@mappedin/mappedin-js/renderer/internal/utils/utils';
9386
+ export { shouldDisableOffscreenCanvas } from '@mappedin/mappedin-js/renderer/internal/utils/browser';
9387
+ export { throttle, debounce } from '@mappedin/mappedin-js/renderer/internal/utils/async';
9444
9388
  }
9445
9389
 
9446
9390
  declare module '@mappedin/mappedin-js/renderer/internal/Mappedin.MapManager' {
@@ -10660,6 +10604,7 @@ declare module '@mappedin/mappedin-js/get-venue/MappedinVortex' {
10660
10604
  weight?: number;
10661
10605
  multiplier?: number;
10662
10606
  nodes?: string[];
10607
+ filterFlags?: string[];
10663
10608
  constructor(data: any);
10664
10609
  static hydrate(vortexes: any): MappedinVortex[];
10665
10610
  static fetch(mappedin: Mappedin): Promise<MappedinVortex[]>;
@@ -10992,12 +10937,12 @@ declare module '@mappedin/mappedin-js/get-venue/MappedinMapGroup' {
10992
10937
  }
10993
10938
 
10994
10939
  declare module '@mappedin/mappedin-js/get-venue/utils' {
10995
- import type { TGetVenueOptions, TGetVenueOptionsInternal } from '@mappedin/mappedin-js/get-venue/Mappedin.types';
10940
+ import type { MergedThings, TGetVenueOptions, TGetVenueOptionsInternal, ThingsOption } from '@mappedin/mappedin-js/get-venue/Mappedin.types';
10996
10941
  import type { MappedinMap } from '@mappedin/mappedin-js/get-venue/internal';
10997
10942
  import { Mappedin, MappedinNavigatable, MappedinNode, MappedinPolygon, MappedinLocation, MappedinCoordinate } from '@mappedin/mappedin-js/get-venue/internal';
10998
10943
  export function isGatewayKey(key: string): boolean;
10999
10944
  export function stringifyQuery(query: any, gateway?: boolean): string;
11000
- export function buildUrl(options: TGetVenueOptionsInternal & TGetVenueOptions, pathname: string, query: any, supplementary?: boolean): string;
10945
+ export function buildUrl(options: TGetVenueOptionsInternal<TGetVenueOptions>, pathname: string, query: any, supplementary?: boolean): string;
11001
10946
  /**
11002
10947
  * Make a network request to the Mappedin API to fetch an array of objects.
11003
10948
  * @param options options from getVenue- baseUrl and supplementaryUrl are used
@@ -11006,7 +10951,7 @@ declare module '@mappedin/mappedin-js/get-venue/utils' {
11006
10951
  * @param supplementary whether to use the supplementaryUrl when sending the request
11007
10952
  * @returns the result json
11008
10953
  */
11009
- export function getArray(options: TGetVenueOptionsInternal & TGetVenueOptions, pathname: string, query: any, supplementary?: boolean): Promise<any>;
10954
+ export function getArray(options: TGetVenueOptionsInternal<TGetVenueOptions>, pathname: string, query: any, supplementary?: boolean): Promise<any>;
11010
10955
  /**
11011
10956
  * Make a network request to the Mappedin API to fetch an object.
11012
10957
  * @param options options from getVenue- baseUrl and supplementaryUrl are used
@@ -11016,21 +10961,21 @@ declare module '@mappedin/mappedin-js/get-venue/utils' {
11016
10961
  * @param isExpectingArray whether the endpoint returns an array
11017
10962
  * @returns the result json
11018
10963
  */
11019
- export function getObject(options: TGetVenueOptionsInternal & TGetVenueOptions, pathname: string, query: any, supplementary?: boolean, isExpectingArray?: boolean): Promise<any>;
10964
+ export function getObject(options: TGetVenueOptionsInternal<TGetVenueOptions>, pathname: string, query: any, supplementary?: boolean, isExpectingArray?: boolean): Promise<any>;
11020
10965
  /**
11021
10966
  * Prepares the request and URL fields to pass into generateAPIRequest
11022
10967
  * @param options options from getVenue- baseUrl and supplementaryUrl are used
11023
10968
  * @param url string describing the url corresponding to the client's request
11024
10969
  * @param supplementary whether to use the supplementaryUrl when sending the request
11025
10970
  */
11026
- export function constructParamsForRequest(options: TGetVenueOptionsInternal & TGetVenueOptions, url: string, supplementary?: boolean): {
10971
+ export function constructParamsForRequest(options: TGetVenueOptionsInternal<TGetVenueOptions>, url: string, supplementary?: boolean): {
11027
10972
  req: {
11028
10973
  method: string;
11029
10974
  headers: any;
11030
10975
  };
11031
10976
  url: string;
11032
10977
  };
11033
- export function generateAPIRequest(options: TGetVenueOptionsInternal & TGetVenueOptions, url: string, supplementary?: boolean): Promise<any>;
10978
+ export function generateAPIRequest(options: TGetVenueOptionsInternal<TGetVenueOptions>, url: string, supplementary?: boolean): Promise<any>;
11034
10979
  export function addToSet(array: any, value: any): void;
11035
10980
  export function getDistanceBetweenLatLon([lat1, lon1]: [number, number], [lat2, lon2]: [number, number]): any;
11036
10981
  export function getMapScale(map: MappedinMap): any;
@@ -11064,6 +11009,7 @@ declare module '@mappedin/mappedin-js/get-venue/utils' {
11064
11009
  * @return {MappedinLocation}
11065
11010
  */
11066
11011
  export const getPrimaryLocationForPolygon: (polygon: MappedinPolygon | string | undefined, venue: Mappedin) => MappedinLocation | null;
11012
+ export function mergeThings(thingsOption: ThingsOption | undefined): MergedThings;
11067
11013
  }
11068
11014
 
11069
11015
  declare module '@mappedin/mappedin-js/get-venue/Mappedin.cache' {
@@ -11122,7 +11068,7 @@ declare module '@mappedin/mappedin-js/get-venue/Mappedin.cache' {
11122
11068
  }
11123
11069
 
11124
11070
  declare module '@mappedin/mappedin-js/renderer/internal/shave-text' {
11125
- export type TDrawFn = (ctx: CanvasRenderingContext2D, x: number, y: number) => void;
11071
+ export type TDrawFn = (ctx: CanvasRenderingContext2D | OffscreenCanvasRenderingContext2D, x: number, y: number) => void;
11126
11072
  type TShave = (str: string, size: number, maxWidth: number, maxLines?: number, lineHeight?: number, options?: {
11127
11073
  strokeText: boolean;
11128
11074
  }) => {
@@ -11404,6 +11350,203 @@ declare module '@mappedin/mappedin-js/renderer/internal/Mappedin.EffectComposer'
11404
11350
  export {};
11405
11351
  }
11406
11352
 
11353
+ declare module '@mappedin/mappedin-js/renderer/internal/utils/utils' {
11354
+ import { Box3, Vector3, Object3D, Material } from 'three';
11355
+ import { Mappedin, MapObject, MappedinMap, TMapViewOptions } from '@mappedin/mappedin-js/renderer/internal';
11356
+ import { Camera } from '@mappedin/mappedin-js/renderer/public/api/Camera';
11357
+ /**
11358
+ * Utils function listing
11359
+ *
11360
+ * - scrubMaterial
11361
+ * - getObjectID
11362
+ * - getObject
11363
+ * - getBoundingBox
11364
+ * - getBiggestBoundingBox
11365
+ * - upackBoundingBox
11366
+ * - getMapScale
11367
+ * - throttle -> taken from lodash.js
11368
+ * - getProjectionScaleFactor
11369
+ * - getZoom
11370
+ */
11371
+ export function isGatewayKey(key: string): boolean;
11372
+ export function getCombinedBoundingBox(objects: Object3D[]): Box3;
11373
+ export function getMapsBoundingBox(maps: MapObject[], mapPadding: number): Box3;
11374
+ export function scrubMaterial(material: Material): void;
11375
+ /**
11376
+ * Takes a Mappedin Object or id and returns the ID, so our functions can take bottomRight
11377
+ * @template T extends string | {id: string}
11378
+ * @param {T} object - input can be object containing id or the id itself
11379
+ * @return {string}
11380
+ */
11381
+ export function getObjectId(object: any): string;
11382
+ /**
11383
+ * Takes a Mappedin object or ID and the array to look in and retuns the Object, so our functions can take both
11384
+ */
11385
+ export function getObject<K extends {
11386
+ id: string;
11387
+ }, T extends K | string>(obj: T, array: K[] | undefined): K | undefined;
11388
+ export function getBoundingBox(object: Object3D): Box3;
11389
+ /**
11390
+ * Function pushes the items of the second array onto the first array (inplace).
11391
+ * @template T
11392
+ * @param {Array.<T>} arr1 - base array
11393
+ * @param {Array.<T>} arr2 - array which items will be pushed to arr1
11394
+ */
11395
+ export function appendItems<T>(arr1: T[], arr2: T[]): void;
11396
+ export function getBiggestBoundingBox(objects: Object3D[]): {
11397
+ min: any;
11398
+ max: any;
11399
+ };
11400
+ export function unpackBoundingBox(boundingBox: Box3): Vector3[];
11401
+ export function getMapScale(map: MappedinMap): number;
11402
+ export function getNorth(map: MappedinMap): number;
11403
+ export function flatten(list: any[]): any[];
11404
+ export function uniq(arr: any[]): any[];
11405
+ export function toStyleString(styles: Record<string, string>): string;
11406
+ /**
11407
+ /* getProjectionScaleFactor()
11408
+ /* finds the scale ratio between screen coordinates and 3D coordinates (in X-Z plane)
11409
+ /*
11410
+ * R
11411
+ * /|
11412
+ * C : Camera / |
11413
+ * PQ : Projection Plane / |
11414
+ * OR : Origin / |
11415
+ * F : FOV / |
11416
+ * Q / |
11417
+ * /| |
11418
+ * / | |
11419
+ * / | |
11420
+ * / | |
11421
+ * / | |
11422
+ * / F/2 | |
11423
+ * C ------------P------------ O
11424
+ *
11425
+ *
11426
+ * ProjectionScaleFactor = ( OR / PQ )
11427
+ * PQ = canvasHeight / 2
11428
+ * CQ = zoom
11429
+ *
11430
+ * OR / C0 = tan(F/2)
11431
+ * so OR = CO * tan(F/2)
11432
+ */
11433
+ export function getProjectionScaleFactor(FOV: number, canvasHeight: number, zoom: number): number;
11434
+ /** getZoom
11435
+ *
11436
+ * C - Camera, OP -- picture plane (canvas), S - origin,
11437
+ * QR - front side of maps Bounding Box, F: FOV
11438
+ *
11439
+ * Z-axis
11440
+ * R_____|______
11441
+ * /| | |
11442
+ * / | | |
11443
+ * P/ | | | maps BB
11444
+ * /| | | |
11445
+ * / | | | |
11446
+ * / | | | |
11447
+ * / F |E |T |S |
11448
+ * C /--------|-----|-----|-----|------ orthogonal to Y axis, midpoint of focus maps
11449
+ * \ | | | |
11450
+ * \ | | | |
11451
+ * \ | | | |
11452
+ * \ | | | |
11453
+ * \| | | |
11454
+ * O\ | | |
11455
+ * \ | | |
11456
+ * \|_____|_____|
11457
+ * Q
11458
+ *
11459
+ *
11460
+ * We want to get CS, which is the camera zoom
11461
+ *
11462
+ */
11463
+ export function getZoom(focusBox: Box3, focusBoxHeight: number, FOV: number): number;
11464
+ interface CalculateTwoDProjectionsParams {
11465
+ maps: MapObject[];
11466
+ width: number;
11467
+ height: number;
11468
+ camera: Camera;
11469
+ }
11470
+ export function calculateTwoDProjections({ maps, width, height, camera }: CalculateTwoDProjectionsParams): {
11471
+ min: {
11472
+ x: number;
11473
+ y: number;
11474
+ };
11475
+ max: {
11476
+ x: number;
11477
+ y: number;
11478
+ };
11479
+ }[];
11480
+ export function splitLine(startNode: Vector3, endNode: Vector3, segments: number): Vector3[];
11481
+ export function isObject(item: any): boolean;
11482
+ export const determineStartingMap: (venue: Mappedin, options: TMapViewOptions) => MappedinMap;
11483
+ export function cyrb53(str: string, seed?: number): number;
11484
+ export function addMarginMultiplierToBoundingBox(bbox: Box3, multiplier: number): Box3;
11485
+ export function tweenPromise({ from, to, duration, easing, delay, onUpdate, onStart, onComplete, }: {
11486
+ from: any;
11487
+ to: any;
11488
+ duration?: number | undefined;
11489
+ easing?: any;
11490
+ delay?: number | undefined;
11491
+ onUpdate?: ((_: any) => void) | undefined;
11492
+ onStart?: (() => void) | undefined;
11493
+ onComplete?: (() => void) | undefined;
11494
+ }): {
11495
+ start(core: any): Promise<void>;
11496
+ };
11497
+ export const linearEase: (t: number) => number;
11498
+ export const quadEaseIn: (t: number) => number;
11499
+ export const quadEaseOut: (t: number) => number;
11500
+ export function interpolate(value: number, inputMin: number, inputMax: number, outputMin: number, outputMax: number, easeFunc?: (t: number) => number): number;
11501
+ export function interpolateMulti(value: number, inputRange: number[], outputRange: number[], easeFunc?: (t: number) => number): number;
11502
+ export function checkWritableBeforeWrite(obj: any, key: string, value: any): void;
11503
+ export {};
11504
+ }
11505
+
11506
+ declare module '@mappedin/mappedin-js/renderer/internal/utils/browser' {
11507
+ type DeviceType = {
11508
+ isIpad: boolean;
11509
+ isMobile: boolean;
11510
+ isSafari12: boolean;
11511
+ isFirefox: boolean;
11512
+ isWindows: boolean;
11513
+ };
11514
+ /**
11515
+ * Get device OS info
11516
+ * export for testing purpose
11517
+ * @returns DeviceType
11518
+ */
11519
+ export const _deviceTypeControl: {
11520
+ getDeviceType(): DeviceType;
11521
+ _reset(): void;
11522
+ };
11523
+ export const getDeviceType: () => DeviceType;
11524
+ /**
11525
+ * Creates a closure encapsulating the logic of getting device GPU info.
11526
+ * inspired by https://github.com/pmndrs/detect-gpu
11527
+ * export for testing
11528
+ */
11529
+ export const _gpuInfoControl: {
11530
+ getInfo: () => string | undefined;
11531
+ shouldDisableOffscreenCanvas: () => boolean;
11532
+ _setCanvas(c: HTMLCanvasElement): void;
11533
+ };
11534
+ export const getGPUInfo: () => string | undefined;
11535
+ /**
11536
+ * Check if device is certain intel integrated GPU.
11537
+ * This is for implementing workaround - https://issues.chromium.org/issues/40251953
11538
+ * The reason we want to disable OffscreenCanvas at all is due to `willReadFrequently` flag only works in FF.
11539
+ * In order to ensure the integrated intel GPU render text correctly
11540
+ */
11541
+ export const shouldDisableOffscreenCanvas: () => boolean;
11542
+ export {};
11543
+ }
11544
+
11545
+ declare module '@mappedin/mappedin-js/renderer/internal/utils/async' {
11546
+ export function throttle<T>(func: () => void, wait: number, options?: any): () => void;
11547
+ export function debounce<T>(func: () => void, wait: number, immediate?: boolean): () => void;
11548
+ }
11549
+
11407
11550
  declare module '@mappedin/mappedin-js/renderer/internal/Mappedin.MultiFloorView' {
11408
11551
  export namespace VIEW_STATE {
11409
11552
  let SINGLE_FLOOR: string;