@mappedin/mappedin-js 5.29.4-alpha.0 → 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> = {
@@ -1632,6 +1635,13 @@ declare module '@mappedin/mappedin-js/renderer/MapView.types' {
1632
1635
  outdoorGeometryLayers?: string[];
1633
1636
  /**
1634
1637
  * Use the current polygon objects directly rather than what is stored when rendering the map in CMS.
1638
+ *
1639
+ * Important Considerations:
1640
+ * - When this flag is set to true, the application will use live polygon data, which might not include certain enhancements such as 3D text annotations or automatically generated infill patterns. These features typically depend on the CMS's Render capabilities.
1641
+ * - Opting for live polygons means the system will not utilize the pre-processed optimized polygon data that is available through the CMS's rendering pipeline.
1642
+ * - This option is useful for applications requiring the most up-to-date representation of polygon data but may result in a less detailed visual representation due to the absence of certain rendered features.
1643
+ *
1644
+ * Use this option with caution, understanding the trade-offs between real-time update and visual detail.
1635
1645
  */
1636
1646
  useLivePolygons?: boolean;
1637
1647
  };
@@ -1640,7 +1650,7 @@ declare module '@mappedin/mappedin-js/renderer/MapView.types' {
1640
1650
  * Requires `multiBufferRendering` to be enabled.
1641
1651
  * @experimental
1642
1652
  */
1643
- outdoorView?: TOutdoorViewControllerOptions & {
1653
+ outdoorView?: TOutdoorViewOptions & {
1644
1654
  enabled?: boolean;
1645
1655
  };
1646
1656
  /**
@@ -1777,6 +1787,10 @@ declare module '@mappedin/mappedin-js/renderer/MapView.types' {
1777
1787
  onWebGLRendererError?: () => void;
1778
1788
  };
1779
1789
  export type TShowVenueOptions = {
1790
+ /**
1791
+ * Enable shading of bottoms of geometry along with outlines to make geometry stand out.
1792
+ */
1793
+ shadingAndOutlines?: boolean;
1780
1794
  /**
1781
1795
  * @experimental
1782
1796
  *
@@ -1834,7 +1848,7 @@ declare module '@mappedin/mappedin-js/renderer/MapView.types' {
1834
1848
  * @experimental
1835
1849
  * Enable outdoor view. Requires multi-buffer rendering to be enabled
1836
1850
  */
1837
- outdoorView?: TOutdoorViewControllerOptions & {
1851
+ outdoorView?: TOutdoorViewOptions & {
1838
1852
  enabled?: boolean;
1839
1853
  };
1840
1854
  /**
@@ -2339,6 +2353,7 @@ declare module '@mappedin/mappedin-js/renderer/MapView.types' {
2339
2353
  */
2340
2354
  [E_CAMERA_EVENT.TILT_CHANGED]: number;
2341
2355
  };
2356
+ export type { TOutdoorViewOptions, TOutdoorViewOptionsWithHeaders, TOutdoorViewOptionsWithAuthURL };
2342
2357
  export type { default as BlueDotController } from '@mappedin/mappedin-js/renderer/private/controllers/BlueDotController';
2343
2358
  export type { default as Journey } from '@mappedin/mappedin-js/renderer/public/api/Journey';
2344
2359
  }
@@ -4751,6 +4766,14 @@ declare module '@mappedin/mappedin-js/renderer/public/api/Exporter' {
4751
4766
  }
4752
4767
 
4753
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>;
4754
4777
  export type TGetVenueOptions = {
4755
4778
  accessToken?: string;
4756
4779
  clientId?: string;
@@ -4764,22 +4787,44 @@ declare module '@mappedin/mappedin-js/get-venue/Mappedin.types' {
4764
4787
  [key in string]: string;
4765
4788
  };
4766
4789
  venue: string;
4767
- 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;
4768
4803
  useDraftData?: boolean;
4769
4804
  platformString?: string;
4770
4805
  emitAnalyticsEvents?: boolean;
4771
4806
  secure?: boolean;
4772
4807
  preloadMapGeometry?: boolean;
4773
4808
  };
4774
- 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 & {
4775
4819
  baseUrl?: string;
4776
4820
  supplementaryUrl?: string;
4777
4821
  noAuth?: boolean;
4778
4822
  includeHidden?: boolean;
4779
4823
  apiGateway?: string;
4780
4824
  authorization?: string;
4781
- things?: any;
4782
4825
  headers?: any;
4826
+ }, 'things'> & {
4827
+ things?: MergedThings;
4783
4828
  };
4784
4829
  export type TVenueMetadata = {
4785
4830
  languages: {
@@ -4802,14 +4847,14 @@ declare module '@mappedin/mappedin-js/get-venue/Mappedin.types' {
4802
4847
 
4803
4848
  declare module '@mappedin/mappedin-js/get-venue/Mappedin' {
4804
4849
  import { Navigator } from '@mappedin/mappedin-js/navigator';
4805
- 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';
4806
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';
4807
4852
  import { TAccessors, GET_VENUE_EVENT } from '@mappedin/mappedin-js/get-venue/internal';
4808
4853
  import { IAnalytics } from '@mappedin/mappedin-js/get-venue/Mappedin.CustomerAnalytics';
4809
4854
  import { ParsedMVF } from '@mappedin/mvf';
4810
4855
  import { ParsedMVFv1 } from '@mappedin/mappedin-js/get-venue/Mappedin.MVF.types';
4811
4856
  import { PubSub } from '@mappedin/mappedin-js/get-venue/pub-sub.typed';
4812
- export const defaultOptions: TGetVenueOptionsInternal & TGetVenueOptions;
4857
+ export const defaultOptions: TGetVenueOptionsInternal<TGetVenueOptions>;
4813
4858
  export class Mappedin extends PubSub<GET_VENUE_PAYLOAD, GET_VENUE_EVENT> {
4814
4859
  #private;
4815
4860
  perspective: any;
@@ -5041,7 +5086,7 @@ declare module '@mappedin/mappedin-js/get-venue/Mappedin' {
5041
5086
  /**
5042
5087
  * @deprecated Use {@link hydrateVenue} instead
5043
5088
  */
5044
- constructor(options: TGetVenueOptionsInternal & TGetVenueOptions);
5089
+ constructor(options: TGetVenueOptionsInternal<TAllGetVenueOptions>);
5045
5090
  analytics: IAnalytics;
5046
5091
  /**
5047
5092
  * @hidden
@@ -5071,6 +5116,7 @@ declare module '@mappedin/mappedin-js/get-venue/default-things' {
5071
5116
  themes: string[];
5072
5117
  rankings: string[];
5073
5118
  };
5119
+ export type DefaultThings = typeof defaultThings;
5074
5120
  }
5075
5121
 
5076
5122
  declare module '@mappedin/mappedin-js/get-venue/internal' {
@@ -5342,6 +5388,7 @@ declare module '@mappedin/mappedin-js/get-venue/MappedinLocation' {
5342
5388
  siblingGroups?: TSiblingGroup[] | undefined;
5343
5389
  gallery?: TGalleryImage[] | undefined;
5344
5390
  amenity?: string | undefined;
5391
+ filterFlags?: string[];
5345
5392
  constructor(mappedin: Mappedin, data: any);
5346
5393
  /**
5347
5394
  * Polygons this Location is attached to.
@@ -6221,45 +6268,97 @@ declare module '@mappedin/mappedin-js/renderer/private/controllers/OutdoorViewCo
6221
6268
  import './OutdoorViewController.scss';
6222
6269
  import type { ICore } from '@mappedin/mappedin-js/renderer/internal';
6223
6270
  import { XOR } from '@mappedin/mappedin-js/renderer/MapView.types';
6271
+ /**
6272
+ * Represents the possible positions for map attribution.
6273
+ */
6224
6274
  export type TAttributionPosition = 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right';
6225
- export type TOutdoorViewControllerOptionsWithHeaders = {
6226
- url?: string;
6227
- attributionPosition?: TAttributionPosition;
6228
- customAttribution?: string | string[];
6229
- headers: {
6230
- [key: string]: string | null;
6231
- };
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
+ };
6232
6299
  };
6233
- export type TOutdoorViewControllerOptionsWithAuthURL = {
6234
- url?: string;
6235
- authURL?: string;
6236
- customAttribution?: string | string[];
6237
- 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';
6238
6322
  };
6239
- 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>;
6240
6339
  class OutdoorViewController {
6241
- _attribution: any;
6242
- core: ICore;
6243
- map: any;
6244
- enabled: boolean;
6245
- hidden: boolean;
6246
- url: string;
6247
- authURL: string;
6248
- headers?: TOutdoorViewControllerOptions['headers'];
6249
- customAttribution?: string | string[];
6250
- attributionPosition?: TAttributionPosition;
6251
- loaded: boolean;
6252
- constructor(core: ICore, options?: TOutdoorViewControllerOptions);
6253
- module: any;
6254
- load(): Promise<void>;
6255
- get attributions(): any;
6256
- hide(): void;
6257
- show(): void;
6258
- resize(): void;
6259
- getRequestHeaders: () => Promise<TOutdoorViewControllerOptions['headers']>;
6260
- render(): void;
6261
- setStyle(style: any): void;
6262
- 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;
6263
6362
  }
6264
6363
  export default OutdoorViewController;
6265
6364
  }
@@ -6477,8 +6576,7 @@ declare module '@mappedin/mappedin-js/navigator/Directive' {
6477
6576
  }
6478
6577
 
6479
6578
  declare module '@mappedin/mappedin-js/renderer/private/controllers/FlatLabelsController' {
6480
- import { TAddFlatLabelOptions, TFlatLabelAllLocationsOptions, TFlatLabelAppearance, ICore } from '@mappedin/mappedin-js/renderer/internal';
6481
- import { FlatLabel } from '@mappedin/mappedin-js/renderer/internal';
6579
+ import { TAddFlatLabelOptions, TFlatLabelAllLocationsOptions, TFlatLabelAppearance, ICore, FlatLabel } from '@mappedin/mappedin-js/renderer/internal';
6482
6580
  import { MappedinPolygon } from '@mappedin/mappedin-js/get-venue';
6483
6581
  export const LABEL_ALL_LOCATIONS_WARNING = "Adding or removing individual labels after calling labelAllLocations() may cause unexpected behaviour. We recommend adding all labels individually if more specific control is desired. https://developer.mappedin.com/web-sdk-api/v5/latest/classes/flatlabels#add";
6484
6582
  export type FlatLabelRenderObject = TAddFlatLabelOptions & {
@@ -8121,6 +8219,17 @@ declare module '@mappedin/mappedin-js/renderer/internal/Mappedin.Element' {
8121
8219
  assetManager: AssetManager;
8122
8220
  imageVisible: boolean;
8123
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;
8124
8233
  boundingBox: {
8125
8234
  min: {
8126
8235
  x: number;
@@ -8133,13 +8242,6 @@ declare module '@mappedin/mappedin-js/renderer/internal/Mappedin.Element' {
8133
8242
  z: number;
8134
8243
  };
8135
8244
  };
8136
- polygonHeight: number;
8137
- geometry: ExtrudeGeometry;
8138
- mesh: Mesh;
8139
- material: MeshLambertMaterial | MeshLambertMaterial[];
8140
- labelMesh?: Mesh;
8141
- imageMesh?: Mesh;
8142
- sortScore: number | null;
8143
8245
  static materials: {
8144
8246
  [key in string]: MeshLambertMaterial | MeshLambertMaterial[];
8145
8247
  };
@@ -8155,7 +8257,8 @@ declare module '@mappedin/mappedin-js/renderer/internal/Mappedin.Element' {
8155
8257
  x: number;
8156
8258
  y: number;
8157
8259
  };
8158
- 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;
8159
8262
  static _setPolygonDefaults(poly: any): any;
8160
8263
  constructor(poly: MappedinPolygon, mapClass: MappedinMap, container: Group, assetManager: any, mapLoadingStrategy?: MAP_RENDER_MODE);
8161
8264
  getBoundingBox(): {
@@ -9279,158 +9382,9 @@ declare module '@mappedin/mappedin-js/renderer/internal/Mappedin.BlueDot/Mappedi
9279
9382
  }
9280
9383
 
9281
9384
  declare module '@mappedin/mappedin-js/renderer/internal/utils' {
9282
- import { Box3, Vector3, Object3D, Material } from 'three';
9283
- import { Mappedin, MapObject, MappedinMap, TMapViewOptions } from '@mappedin/mappedin-js/renderer/internal';
9284
- import { Camera } from '@mappedin/mappedin-js/renderer/public/api/Camera';
9285
- /**
9286
- * Utils function listing
9287
- *
9288
- * - scrubMaterial
9289
- * - getObjectID
9290
- * - getObject
9291
- * - getBoundingBox
9292
- * - getBiggestBoundingBox
9293
- * - upackBoundingBox
9294
- * - getMapScale
9295
- * - throttle -> taken from lodash.js
9296
- * - getProjectionScaleFactor
9297
- * - getZoom
9298
- */
9299
- export function isGatewayKey(key: string): boolean;
9300
- export function getCombinedBoundingBox(objects: Object3D[]): Box3;
9301
- export function getMapsBoundingBox(maps: MapObject[], mapPadding: number): Box3;
9302
- export function scrubMaterial(material: Material): void;
9303
- /**
9304
- * Takes a Mappedin Object or id and returns the ID, so our functions can take bottomRight
9305
- * @template T extends string | {id: string}
9306
- * @param {T} object - input can be object containing id or the id itself
9307
- * @return {string}
9308
- */
9309
- export function getObjectId(object: any): string;
9310
- /**
9311
- * Takes a Mappedin object or ID and the array to look in and retuns the Object, so our functions can take both
9312
- */
9313
- export function getObject<K extends {
9314
- id: string;
9315
- }, T extends K | string>(obj: T, array: K[] | undefined): K | undefined;
9316
- export function getBoundingBox(object: Object3D): Box3;
9317
- /**
9318
- * Function pushes the items of the second array onto the first array (inplace).
9319
- * @template T
9320
- * @param {Array.<T>} arr1 - base array
9321
- * @param {Array.<T>} arr2 - array which items will be pushed to arr1
9322
- */
9323
- export function appendItems<T>(arr1: T[], arr2: T[]): void;
9324
- export function getBiggestBoundingBox(objects: Object3D[]): {
9325
- min: any;
9326
- max: any;
9327
- };
9328
- export function unpackBoundingBox(boundingBox: Box3): Vector3[];
9329
- export function getMapScale(map: MappedinMap): number;
9330
- export function getNorth(map: MappedinMap): number;
9331
- export function throttle<T>(func: () => void, wait: number, options?: any): () => void;
9332
- export function debounce<T>(func: () => void, wait: number, immediate?: boolean): () => void;
9333
- export function flatten(list: any[]): any[];
9334
- export function uniq(arr: any[]): any[];
9335
- export function toStyleString(styles: Record<string, string>): string;
9336
- /**
9337
- /* getProjectionScaleFactor()
9338
- /* finds the scale ratio between screen coordinates and 3D coordinates (in X-Z plane)
9339
- /*
9340
- * R
9341
- * /|
9342
- * C : Camera / |
9343
- * PQ : Projection Plane / |
9344
- * OR : Origin / |
9345
- * F : FOV / |
9346
- * Q / |
9347
- * /| |
9348
- * / | |
9349
- * / | |
9350
- * / | |
9351
- * / | |
9352
- * / F/2 | |
9353
- * C ------------P------------ O
9354
- *
9355
- *
9356
- * ProjectionScaleFactor = ( OR / PQ )
9357
- * PQ = canvasHeight / 2
9358
- * CQ = zoom
9359
- *
9360
- * OR / C0 = tan(F/2)
9361
- * so OR = CO * tan(F/2)
9362
- */
9363
- export function getProjectionScaleFactor(FOV: number, canvasHeight: number, zoom: number): number;
9364
- /** getZoom
9365
- *
9366
- * C - Camera, OP -- picture plane (canvas), S - origin,
9367
- * QR - front side of maps Bounding Box, F: FOV
9368
- *
9369
- * Z-axis
9370
- * R_____|______
9371
- * /| | |
9372
- * / | | |
9373
- * P/ | | | maps BB
9374
- * /| | | |
9375
- * / | | | |
9376
- * / | | | |
9377
- * / F |E |T |S |
9378
- * C /--------|-----|-----|-----|------ orthogonal to Y axis, midpoint of focus maps
9379
- * \ | | | |
9380
- * \ | | | |
9381
- * \ | | | |
9382
- * \ | | | |
9383
- * \| | | |
9384
- * O\ | | |
9385
- * \ | | |
9386
- * \|_____|_____|
9387
- * Q
9388
- *
9389
- *
9390
- * We want to get CS, which is the camera zoom
9391
- *
9392
- */
9393
- export function getZoom(focusBox: Box3, focusBoxHeight: number, FOV: number): number;
9394
- interface CalculateTwoDProjectionsParams {
9395
- maps: MapObject[];
9396
- width: number;
9397
- height: number;
9398
- camera: Camera;
9399
- }
9400
- export function calculateTwoDProjections({ maps, width, height, camera }: CalculateTwoDProjectionsParams): {
9401
- min: {
9402
- x: number;
9403
- y: number;
9404
- };
9405
- max: {
9406
- x: number;
9407
- y: number;
9408
- };
9409
- }[];
9410
- export function splitLine(startNode: Vector3, endNode: Vector3, segments: number): Vector3[];
9411
- export function isObject(item: any): boolean;
9412
- export const determineStartingMap: (venue: Mappedin, options: TMapViewOptions) => MappedinMap;
9413
- export function cyrb53(str: string, seed?: number): number;
9414
- export function addMarginMultiplierToBoundingBox(bbox: Box3, multiplier: number): Box3;
9415
- export function tweenPromise({ from, to, duration, easing, delay, onUpdate, onStart, onComplete, }: {
9416
- from: any;
9417
- to: any;
9418
- duration?: number | undefined;
9419
- easing?: any;
9420
- delay?: number | undefined;
9421
- onUpdate?: ((_: any) => void) | undefined;
9422
- onStart?: (() => void) | undefined;
9423
- onComplete?: (() => void) | undefined;
9424
- }): {
9425
- start(core: any): Promise<void>;
9426
- };
9427
- export const linearEase: (t: number) => number;
9428
- export const quadEaseIn: (t: number) => number;
9429
- export const quadEaseOut: (t: number) => number;
9430
- export function interpolate(value: number, inputMin: number, inputMax: number, outputMin: number, outputMax: number, easeFunc?: (t: number) => number): number;
9431
- export function interpolateMulti(value: number, inputRange: number[], outputRange: number[], easeFunc?: (t: number) => number): number;
9432
- export function checkWritableBeforeWrite(obj: any, key: string, value: any): void;
9433
- 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';
9434
9388
  }
9435
9389
 
9436
9390
  declare module '@mappedin/mappedin-js/renderer/internal/Mappedin.MapManager' {
@@ -10650,6 +10604,7 @@ declare module '@mappedin/mappedin-js/get-venue/MappedinVortex' {
10650
10604
  weight?: number;
10651
10605
  multiplier?: number;
10652
10606
  nodes?: string[];
10607
+ filterFlags?: string[];
10653
10608
  constructor(data: any);
10654
10609
  static hydrate(vortexes: any): MappedinVortex[];
10655
10610
  static fetch(mappedin: Mappedin): Promise<MappedinVortex[]>;
@@ -10982,12 +10937,12 @@ declare module '@mappedin/mappedin-js/get-venue/MappedinMapGroup' {
10982
10937
  }
10983
10938
 
10984
10939
  declare module '@mappedin/mappedin-js/get-venue/utils' {
10985
- 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';
10986
10941
  import type { MappedinMap } from '@mappedin/mappedin-js/get-venue/internal';
10987
10942
  import { Mappedin, MappedinNavigatable, MappedinNode, MappedinPolygon, MappedinLocation, MappedinCoordinate } from '@mappedin/mappedin-js/get-venue/internal';
10988
10943
  export function isGatewayKey(key: string): boolean;
10989
10944
  export function stringifyQuery(query: any, gateway?: boolean): string;
10990
- 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;
10991
10946
  /**
10992
10947
  * Make a network request to the Mappedin API to fetch an array of objects.
10993
10948
  * @param options options from getVenue- baseUrl and supplementaryUrl are used
@@ -10996,7 +10951,7 @@ declare module '@mappedin/mappedin-js/get-venue/utils' {
10996
10951
  * @param supplementary whether to use the supplementaryUrl when sending the request
10997
10952
  * @returns the result json
10998
10953
  */
10999
- 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>;
11000
10955
  /**
11001
10956
  * Make a network request to the Mappedin API to fetch an object.
11002
10957
  * @param options options from getVenue- baseUrl and supplementaryUrl are used
@@ -11006,21 +10961,21 @@ declare module '@mappedin/mappedin-js/get-venue/utils' {
11006
10961
  * @param isExpectingArray whether the endpoint returns an array
11007
10962
  * @returns the result json
11008
10963
  */
11009
- 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>;
11010
10965
  /**
11011
10966
  * Prepares the request and URL fields to pass into generateAPIRequest
11012
10967
  * @param options options from getVenue- baseUrl and supplementaryUrl are used
11013
10968
  * @param url string describing the url corresponding to the client's request
11014
10969
  * @param supplementary whether to use the supplementaryUrl when sending the request
11015
10970
  */
11016
- export function constructParamsForRequest(options: TGetVenueOptionsInternal & TGetVenueOptions, url: string, supplementary?: boolean): {
10971
+ export function constructParamsForRequest(options: TGetVenueOptionsInternal<TGetVenueOptions>, url: string, supplementary?: boolean): {
11017
10972
  req: {
11018
10973
  method: string;
11019
10974
  headers: any;
11020
10975
  };
11021
10976
  url: string;
11022
10977
  };
11023
- 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>;
11024
10979
  export function addToSet(array: any, value: any): void;
11025
10980
  export function getDistanceBetweenLatLon([lat1, lon1]: [number, number], [lat2, lon2]: [number, number]): any;
11026
10981
  export function getMapScale(map: MappedinMap): any;
@@ -11054,6 +11009,7 @@ declare module '@mappedin/mappedin-js/get-venue/utils' {
11054
11009
  * @return {MappedinLocation}
11055
11010
  */
11056
11011
  export const getPrimaryLocationForPolygon: (polygon: MappedinPolygon | string | undefined, venue: Mappedin) => MappedinLocation | null;
11012
+ export function mergeThings(thingsOption: ThingsOption | undefined): MergedThings;
11057
11013
  }
11058
11014
 
11059
11015
  declare module '@mappedin/mappedin-js/get-venue/Mappedin.cache' {
@@ -11112,7 +11068,7 @@ declare module '@mappedin/mappedin-js/get-venue/Mappedin.cache' {
11112
11068
  }
11113
11069
 
11114
11070
  declare module '@mappedin/mappedin-js/renderer/internal/shave-text' {
11115
- export type TDrawFn = (ctx: CanvasRenderingContext2D, x: number, y: number) => void;
11071
+ export type TDrawFn = (ctx: CanvasRenderingContext2D | OffscreenCanvasRenderingContext2D, x: number, y: number) => void;
11116
11072
  type TShave = (str: string, size: number, maxWidth: number, maxLines?: number, lineHeight?: number, options?: {
11117
11073
  strokeText: boolean;
11118
11074
  }) => {
@@ -11394,6 +11350,203 @@ declare module '@mappedin/mappedin-js/renderer/internal/Mappedin.EffectComposer'
11394
11350
  export {};
11395
11351
  }
11396
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
+
11397
11550
  declare module '@mappedin/mappedin-js/renderer/internal/Mappedin.MultiFloorView' {
11398
11551
  export namespace VIEW_STATE {
11399
11552
  let SINGLE_FLOOR: string;