@mappedin/mappedin-js 6.0.1-beta.52 → 6.0.1-beta.53

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.
Files changed (41) hide show
  1. package/lib/esm/{GLTFExporter-QN63B2QE.js → GLTFExporter-YFXXQH2L.js} +2 -2
  2. package/lib/esm/{GLTFLoader-7E66XH6W.js → GLTFLoader-LZNQSDLP.js} +2 -2
  3. package/lib/esm/{browser-UPE3UIJH.js → browser-L6WJGOEX.js} +2 -2
  4. package/lib/esm/{chunk-RMM4JL5D.js → chunk-BNEW6WES.js} +2 -2
  5. package/lib/esm/{chunk-EDIABNX3.js → chunk-EMVX4D2H.js} +2 -2
  6. package/lib/esm/{chunk-A2N3FISM.js → chunk-KKLQ3TRA.js} +3 -3
  7. package/lib/esm/{chunk-A2N3FISM.js.map → chunk-KKLQ3TRA.js.map} +3 -3
  8. package/lib/esm/{chunk-F3D2AS2N.js → chunk-LWBDZWW4.js} +2 -2
  9. package/lib/esm/chunk-ROCNZJLL.js +2 -0
  10. package/lib/esm/chunk-T5QQA4HH.js +2 -0
  11. package/lib/esm/{chunk-X26M5SQZ.js.map → chunk-T5QQA4HH.js.map} +1 -1
  12. package/lib/esm/chunk-W57RTQ3G.js +2214 -0
  13. package/lib/esm/{chunk-CUKGTP3B.js.map → chunk-W57RTQ3G.js.map} +4 -4
  14. package/lib/esm/{chunk-UQJ6CFWP.js → chunk-Y5QWL6TS.js} +2 -2
  15. package/lib/esm/{dist-33QC5I55.js → dist-HJXMUEN5.js} +2 -2
  16. package/lib/esm/index.d.ts +614 -480
  17. package/lib/esm/index.js +1 -1
  18. package/lib/esm/{inspector-2YAWFES6.js → inspector-FXVGOLBH.js} +2 -2
  19. package/lib/esm/{internal-GHV4UNDA.js → internal-7ECOLP5R.js} +2 -2
  20. package/lib/esm/{outdoor-context-v4-5AXRLXXA.js → outdoor-context-v4-IZYE32JG.js} +2 -2
  21. package/lib/esm/{roboto-regular-25PMWR2T.js → roboto-regular-R5KXKW73.js} +2 -2
  22. package/lib/esm/{text3d-3IUOJSOH.js → text3d-2TVGBQ3N.js} +18 -18
  23. package/lib/esm/{text3d-3IUOJSOH.js.map → text3d-2TVGBQ3N.js.map} +3 -3
  24. package/lib/index-rn.js +194 -194
  25. package/package.json +2 -2
  26. package/lib/esm/chunk-AHC6OWNT.js +0 -2
  27. package/lib/esm/chunk-CUKGTP3B.js +0 -2214
  28. package/lib/esm/chunk-X26M5SQZ.js +0 -2
  29. /package/lib/esm/{GLTFExporter-QN63B2QE.js.map → GLTFExporter-YFXXQH2L.js.map} +0 -0
  30. /package/lib/esm/{GLTFLoader-7E66XH6W.js.map → GLTFLoader-LZNQSDLP.js.map} +0 -0
  31. /package/lib/esm/{browser-UPE3UIJH.js.map → browser-L6WJGOEX.js.map} +0 -0
  32. /package/lib/esm/{chunk-RMM4JL5D.js.map → chunk-BNEW6WES.js.map} +0 -0
  33. /package/lib/esm/{chunk-EDIABNX3.js.map → chunk-EMVX4D2H.js.map} +0 -0
  34. /package/lib/esm/{chunk-F3D2AS2N.js.map → chunk-LWBDZWW4.js.map} +0 -0
  35. /package/lib/esm/{chunk-AHC6OWNT.js.map → chunk-ROCNZJLL.js.map} +0 -0
  36. /package/lib/esm/{chunk-UQJ6CFWP.js.map → chunk-Y5QWL6TS.js.map} +0 -0
  37. /package/lib/esm/{dist-33QC5I55.js.map → dist-HJXMUEN5.js.map} +0 -0
  38. /package/lib/esm/{inspector-2YAWFES6.js.map → inspector-FXVGOLBH.js.map} +0 -0
  39. /package/lib/esm/{internal-GHV4UNDA.js.map → internal-7ECOLP5R.js.map} +0 -0
  40. /package/lib/esm/{outdoor-context-v4-5AXRLXXA.js.map → outdoor-context-v4-IZYE32JG.js.map} +0 -0
  41. /package/lib/esm/{roboto-regular-25PMWR2T.js.map → roboto-regular-R5KXKW73.js.map} +0 -0
@@ -32,14 +32,13 @@
32
32
 
33
33
  declare module '@mappedin/mappedin-js' {
34
34
  import MapData from '@mappedin/mappedin-js/mappedin-js/src/map-data';
35
- import type { TEvents, TStateChangedInternalPayload, TEventPayload, TClickPayload, THoverPayload, TFloorChangeReason } from '@mappedin/mappedin-js/mappedin-js/src/events';
35
+ import type { TEvents, TMapDataEvents, TStateChangedInternalPayload, TEventPayload, TClickPayload, THoverPayload, TFloorChangeReason } from '@mappedin/mappedin-js/mappedin-js/src/events';
36
36
  import type { TGetMapDataOptions, TGetMapDataWithAccessTokenOptions, TGetMapDataWithCredentialsOptions, TGetMapDataSharedOptions, Environment, TSearchOptions } from '@mappedin/mappedin-js/packages/mvf-utils';
37
37
  import { parseMVF, unzipMVF } from '@packages/internal/mvf-utils';
38
38
  import type { Floor } from '@mappedin/mappedin-js/mappedin-js/src/map-data-objects';
39
39
  import type { ParsedMVF as TMVF, StyleCollection as TMVFStyleCollection, Style as TMVFStyle, LineStringStyle as TMVFLineStringStyle, PolygonStyle as TMVFPolygonStyle, PointStyle as TMVFPointStyle, OperationHours, SiblingGroup, LocationState } from '@mappedin/mvf-v2';
40
40
  import { MapView } from '@mappedin/mappedin-js/mappedin-js/src/map-view';
41
41
  export type { Text3D as Text3DApi } from '@mappedin/mappedin-js/mappedin-js/src/api-geojson/text3d';
42
- export { disableText3DWorker } from '@mappedin/mappedin-js/mappedin-js/src/api-geojson/text3d';
43
42
  import type { InsetPadding, InsetPaddingOption, Shading, PaintStyle, LineStyle, Text3DState, AddText3DOptions, UpdatableText3DState, InitializeText3DState, EnvMapOptions, MapViewState, UpdateModelState, InitializeModelState, WatermarkUpdateOptions, Interpolation } from '@mappedin/mappedin-js/geojson/src';
44
43
  import { enableTestMode, preloadFont } from '@mappedin/mappedin-js/geojson/src';
45
44
  export type { PubSub } from '@packages/internal/common/pubsub';
@@ -52,6 +51,7 @@ declare module '@mappedin/mappedin-js' {
52
51
  import type { TBlueDotEvents, TBlueDotAction, TBlueDotState, GeolocationPositionExtended, TFollowMode, TFollowCameraOptions } from '@mappedin/mappedin-js/mappedin-js/src/api-geojson/blue-dot/blue-dot';
53
52
  import type { TExpandOptions, TStackedMapsEvents, TStackedMapsState } from '@mappedin/mappedin-js/mappedin-js/src/api-geojson/stacked-maps/stacked-maps';
54
53
  import { hydrateMapData, type THydrateMapDataBundle } from '@mappedin/mappedin-js/mappedin-js/src/hydrate-map-data';
54
+ export { disableText3DWorker } from '@mappedin/mappedin-js/mappedin-js/src/api-geojson/text3d';
55
55
  export { hydrateMapData, type THydrateMapDataBundle };
56
56
  export { setLoggerLevel, E_SDK_LOG_LEVEL } from '@packages/internal/common/Mappedin.Logger';
57
57
  /**
@@ -322,6 +322,15 @@ declare module '@mappedin/mappedin-js' {
322
322
  * @default false
323
323
  */
324
324
  hideImagesNotOnCurrentFloor?: boolean;
325
+ /**
326
+ * If true, the map will not use web workers. This will turn off outdoor context, and may negatively impact performance of labels and markers.
327
+ * @internal
328
+ *
329
+ * ⚠️ **WARNING**: Setting this to true is not recommended and should only be used for environments where the CSP does not allow web workers.
330
+ * Disabling web workers may significantly degrade performance and disable outdoor map functionality.
331
+ * @default false
332
+ */
333
+ disableWorkers?: boolean;
325
334
  };
326
335
  /**
327
336
  * @internal
@@ -363,6 +372,19 @@ declare module '@mappedin/mappedin-js' {
363
372
  * @experimental
364
373
  */
365
374
  export const createMapLibreOverlay: (mapData: MapData, showMapOptions?: TShow3DMapOptions) => MappedinMapLibreOverlay;
375
+ /**
376
+ * @internal
377
+ *
378
+ * Note: had to add this here to avoid a circular reference when I put it in options
379
+ * TODO: investigate
380
+ *
381
+ * Check if the worker urls are valid
382
+ * @returns false if workers have not been set, and an object with the worker urls if they are set
383
+ */
384
+ export const checkWorkerUrls: () => Promise<false | {
385
+ collision: boolean;
386
+ maplibre: boolean;
387
+ }>;
366
388
  export const show3dMap: (el: HTMLElement, mapData: MapData, options?: TShow3DMapOptions) => Promise<MapView>;
367
389
  /**
368
390
  * @internal
@@ -370,7 +392,7 @@ declare module '@mappedin/mappedin-js' {
370
392
  */
371
393
  export const show3dMapGeojson: (el: HTMLElement, mapData: MapData, options?: TShow3DMapOptions) => Promise<MapView>;
372
394
  export { parseMVF, unzipMVF, enableTestMode, preloadFont, MAPPEDIN_COLORS };
373
- export type { MapView, MapData, MapViewState, MappedinMapLibreOverlay, TMappedinMapLibreOverlayEvents, TBlueDotEvents, TBlueDotAction, TBlueDotState, GeolocationPositionExtended, TStackedMapsEvents, TExpandOptions, TStackedMapsState, TFollowMode, TFollowCameraOptions, TEvents, TStateChangedInternalPayload, TEventPayload, TFloorChangeReason, TClickPayload, THoverPayload, TShow3DMapOptions, TGetMapDataOptions, TGetMapDataWithAccessTokenOptions, TGetMapDataWithCredentialsOptions, TSearchOptions, TGetMapDataSharedOptions, TAntialiasingOptions, TMVF, PaintStyle, LineStyle, EnvMapOptions, Shading, TMVFStyleCollection, TMVFStyle, TMVFLineStringStyle, TMVFPolygonStyle, TMVFPointStyle, Environment, InsetPadding, InsetPaddingOption, OperationHours, SiblingGroup, LocationState, Text3DState, AddText3DOptions, UpdatableText3DState, InitializeText3DState, UpdateModelState, InitializeModelState, Interpolation, };
395
+ export type { MapView, MapData, MapViewState, MappedinMapLibreOverlay, TMappedinMapLibreOverlayEvents, TBlueDotEvents, TBlueDotAction, TBlueDotState, GeolocationPositionExtended, TStackedMapsEvents, TExpandOptions, TStackedMapsState, TFollowMode, TFollowCameraOptions, TEvents, TMapDataEvents, TStateChangedInternalPayload, TEventPayload, TFloorChangeReason, TClickPayload, THoverPayload, TShow3DMapOptions, TGetMapDataOptions, TGetMapDataWithAccessTokenOptions, TGetMapDataWithCredentialsOptions, TSearchOptions, TGetMapDataSharedOptions, TAntialiasingOptions, TMVF, PaintStyle, LineStyle, EnvMapOptions, Shading, TMVFStyleCollection, TMVFStyle, TMVFLineStringStyle, TMVFPolygonStyle, TMVFPointStyle, Environment, InsetPadding, InsetPaddingOption, OperationHours, SiblingGroup, LocationState, Text3DState, AddText3DOptions, UpdatableText3DState, InitializeText3DState, UpdateModelState, InitializeModelState, Interpolation, };
374
396
  export type * from 'geojson';
375
397
  export type { TUpdateState, TUpdateStates, TLabelState, TGeometryState, TModelState, TShapeState, TDoorsState, TImageState, TWallsState, TCameraAnimationOptions, TAnimationOptions, TFocusOnOptions, TEasingFunction, TCameraTarget, TNavigationTarget, TDirectionZone, TAddMarkerOptions, TAddPathOptions, TLabelAppearance, TAddLabelOptions, TAddModelOptions, TAddModel, TAddImageOptions, TGetDirectionsOptions, TCollisionRankingTier, TMarkerAnchor, TDirectionInstruction, TDirectionInstructionAction, TGetState, TMarkerState, TBlueDotOptions, TBlueDotPositionUpdate, TFocusTarget, IFocusable, IAnchorable, TMapDataObjectTypes, TFloorState, TFacadeState, TSetFloorOptions, TCancellablePromise, TAnimateStateResult, GlobalState, TActionType, TBearingType, TConnectionType, } from '@mappedin/mappedin-js/mappedin-js/src/types';
376
398
  export { WALLS, DOORS, ACTION_TYPE, BEARING_TYPE, CONNECTION_TYPE } from '@mappedin/mappedin-js/mappedin-js/src/types';
@@ -393,7 +415,6 @@ declare module '@mappedin/mappedin-js' {
393
415
 
394
416
  declare module '@mappedin/mappedin-js/mappedin-js/src/map-data' {
395
417
  import { Analytics } from '@mappedin/mappedin-js/mappedin-js/src/analytics';
396
- import { PubSub } from '@packages/internal/common/pubsub';
397
418
  import type { TSearchOptions } from '@packages/internal/mvf-utils';
398
419
  import type { Connection, Door, Floor, MapDataInternal, Space, MapObject, PointOfInterest, Annotation, Coordinate, FloorStack, Node, Facade, Area, EnterpriseCategory, EnterpriseLocation, EnterpriseVenue, LocationProfile, LocationCategory } from '@mappedin/mappedin-js/mappedin-js/src/map-data-objects';
399
420
  import { Search } from '@mappedin/mappedin-js/mappedin-js/src/search';
@@ -401,6 +422,7 @@ declare module '@mappedin/mappedin-js/mappedin-js/src/map-data' {
401
422
  import type { Directions } from '@mappedin/mappedin-js/mappedin-js/src/api-geojson/directions';
402
423
  import type { Query } from '@mappedin/mappedin-js/mappedin-js/src/query';
403
424
  import type { IGeoJSONData } from '@mappedin/mappedin-js/mappedin-js/src/map-data-objects/types';
425
+ import type { TMapDataEvents } from '@mappedin/mappedin-js/mappedin-js/src/events';
404
426
  /**
405
427
  * A WeakMap to associate {@link MapData} instances with their internal representation.
406
428
  * We need a way to get the internal data object from the API
@@ -461,12 +483,7 @@ declare module '@mappedin/mappedin-js/mappedin-js/src/map-data' {
461
483
  * Represents the data for a map, providing access to map elements
462
484
  * like spaces, floors, and points of interest.
463
485
  */
464
- class MapData extends PubSub<{
465
- 'language-change': {
466
- code: string;
467
- name: string;
468
- };
469
- }> {
486
+ class MapData {
470
487
  #private;
471
488
  Analytics: Analytics;
472
489
  /**
@@ -531,6 +548,49 @@ declare module '@mappedin/mappedin-js/mappedin-js/src/map-data' {
531
548
  constructor(internal: MapDataInternal, { search }?: {
532
549
  search?: TSearchOptions;
533
550
  });
551
+ /**
552
+ * Subscribe to MapData events.
553
+ *
554
+ * Listen for events emitted by the MapData instance such as language changes.
555
+ *
556
+ * @param eventName The name of the event to listen for.
557
+ * @param fn The callback function to execute when the event is emitted.
558
+ *
559
+ * @example Listen for language changes
560
+ * ```ts
561
+ * mapData.on('language-change', ({ code, name }) => {
562
+ * console.log(`Language changed to ${name} (${code})`);
563
+ *
564
+ * // Update UI to reflect new language
565
+ * updateInterfaceLanguage(code);
566
+ * });
567
+ * ```
568
+ */
569
+ on: <EventName extends keyof TMapDataEvents>(eventName: EventName, fn: (payload: TMapDataEvents[EventName] extends {
570
+ data: null;
571
+ } ? TMapDataEvents[EventName]["data"] : TMapDataEvents[EventName]) => void) => void;
572
+ /**
573
+ * Unsubscribe from MapData events.
574
+ *
575
+ * @param eventName The name of the event to unsubscribe from.
576
+ * @param fn The callback function that was previously registered with `on()`.
577
+ *
578
+ * @example Remove language change listener
579
+ * ```ts
580
+ * const handleLanguageChange = ({ code, name }) => {
581
+ * console.log(`Language changed to ${name}`);
582
+ * };
583
+ *
584
+ * // Add listener
585
+ * mapData.on('language-change', handleLanguageChange);
586
+ *
587
+ * // Later, remove the listener
588
+ * mapData.off('language-change', handleLanguageChange);
589
+ * ```
590
+ */
591
+ off: <EventName extends keyof TMapDataEvents>(eventName: EventName, fn: (payload: TMapDataEvents[EventName] extends {
592
+ data: null;
593
+ } ? TMapDataEvents[EventName]["data"] : TMapDataEvents[EventName]) => void) => void;
534
594
  /**
535
595
  * Get the current environment configuration.
536
596
  *
@@ -1235,19 +1295,19 @@ declare module '@mappedin/mappedin-js/mappedin-js/src/events' {
1235
1295
  /**
1236
1296
  * Emitted when the Blue Dot's position is updated.
1237
1297
  */
1238
- 'blue-dot-position-update': TBlueDotEvents['position-update'];
1298
+ 'blue-dot-position-update': TBlueDotEvents['blue-dot-position-update'];
1239
1299
  /**
1240
1300
  * Emitted when the Blue Dot's state changes.
1241
1301
  */
1242
- 'blue-dot-state-change': TBlueDotEvents['state-change'];
1302
+ 'blue-dot-state-change': TBlueDotEvents['blue-dot-state-change'];
1243
1303
  /**
1244
1304
  * Emitted when the Blue Dot encounters an error.
1245
1305
  */
1246
- 'blue-dot-error': TBlueDotEvents['error'];
1306
+ 'blue-dot-position-error': TBlueDotEvents['blue-dot-position-error'];
1247
1307
  /**
1248
1308
  * Emitted when the Blue Dot's follow mode changes.
1249
1309
  */
1250
- 'blue-dot-follow-change': TBlueDotEvents['follow-change'];
1310
+ 'blue-dot-follow-change': TBlueDotEvents['blue-dot-follow-change'];
1251
1311
  /**
1252
1312
  * Emitted when a navigation connection is clicked.
1253
1313
  */
@@ -1305,6 +1365,12 @@ declare module '@mappedin/mappedin-js/mappedin-js/src/events' {
1305
1365
  blueDot: boolean;
1306
1366
  };
1307
1367
  };
1368
+ export type TMapDataEvents = {
1369
+ 'language-change': {
1370
+ code: string;
1371
+ name: string;
1372
+ };
1373
+ };
1308
1374
  }
1309
1375
 
1310
1376
  declare module '@mappedin/mappedin-js/packages/mvf-utils' {
@@ -1617,7 +1683,6 @@ declare module '@mappedin/mappedin-js/mappedin-js/src/map-data-objects' {
1617
1683
  declare module '@mappedin/mappedin-js/mappedin-js/src/map-view' {
1618
1684
  import { type RendererCore, type WatermarkUpdateOptions } from '@mappedin/mappedin-js/geojson/src';
1619
1685
  import type { EasingCurve } from '@packages/internal/common';
1620
- import { PubSub } from '@packages/internal/common';
1621
1686
  import { type TEvents, type TShow3DMapOptions } from '@mappedin/mappedin-js/mappedin-js/src';
1622
1687
  import type { Navigation } from '@mappedin/mappedin-js/mappedin-js/src/navigation';
1623
1688
  import type { Camera, Labels, Markers, Models, Paths, Exporter, Directions, Style, Outdoor, Images } from '@mappedin/mappedin-js/mappedin-js/src/api-geojson';
@@ -1717,7 +1782,7 @@ declare module '@mappedin/mappedin-js/mappedin-js/src/map-view' {
1717
1782
  *
1718
1783
  * For help getting started, refer to the [Getting Started Guide](https://developer.mappedin.com/web-sdk/getting-started).
1719
1784
  */
1720
- export class MapView extends PubSub<TEvents> {
1785
+ export class MapView {
1721
1786
  #private;
1722
1787
  /**
1723
1788
  * Controls for the map's camera.
@@ -2711,22 +2776,53 @@ declare module '@mappedin/mappedin-js/geojson/src' {
2711
2776
  export type { Text3DState } from '@mappedin/mappedin-js/geojson/src/components/text3d';
2712
2777
  export { TEXT3D_STYLE_UPDATE_PROPS } from '@mappedin/mappedin-js/geojson/src/entities/utils';
2713
2778
  export { Navigator } from '@mappedin/mappedin-js/packages/geojson-navigator';
2714
- export { debounce } from '@mappedin/mappedin-js/geojson/src/utils';
2715
- export { MAPPEDIN_LAYER_ID } from '@mappedin/mappedin-js/geojson/src/utils/constants';
2779
+ export { interpolate, debounce } from '@packages/internal/common';
2780
+ export { MAPPEDIN_LAYER_ID, MAPLIBRE_WORKER_PATH, COLLISION_WORKER_PATH } from '@mappedin/mappedin-js/geojson/src/utils/constants';
2716
2781
  export type { DebugState, Debug } from '@mappedin/mappedin-js/geojson/src/utils/debug';
2717
2782
  /**
2718
- * Enable test mode for the renderer. This will disable the WebGLRenderer and WebGL1Renderer and replace them with a dummy object
2719
- * so you can run tests against it
2720
- */
2783
+ * Enable test mode for the renderer. This will disable the WebGLRenderer and WebGL1Renderer and replace them with a dummy object
2784
+ * so you can run tests against it
2785
+ */
2721
2786
  export { enableTestMode } from '@mappedin/mappedin-js/geojson/src/services/test-mode';
2722
2787
  export { mountSceneGraphVisualizer };
2723
2788
  export type { EntityId, EntityState, LineStyle, PaintStyle, ModelProperties, Shading, ImagePlacementOptions, } from '@mappedin/mappedin-js/geojson/src/types';
2724
2789
  export type * from 'geojson';
2790
+ export let maplibreWorkerUrl: string;
2791
+ export function setMaplibreWorkerUrl(url: string): void;
2792
+ export let collisionWorkerUrl: string;
2793
+ /**
2794
+ * Sets the URL for the collision system worker script.
2795
+ *
2796
+ * This function allows specifying a custom URL for the collision system's web worker,
2797
+ * which is particularly useful in environments with strict Content Security Policy (CSP)
2798
+ * that don't allow blob: URLs or inline scripts.
2799
+ *
2800
+ * When provided, the collision system will load its worker from the specified URL
2801
+ * instead of creating an inline worker from a blob. This enables compatibility with
2802
+ * environments that have restrictive CSP settings.
2803
+ *
2804
+ * @param url - The absolute URL pointing to the collision worker script.
2805
+ * This should be a URL where the compiled version of the worker.ts file is hosted.
2806
+ *
2807
+ * @example
2808
+ * ```typescript
2809
+ * // Set a custom URL for the collision worker
2810
+ * import { setWorkerUrl } from '@mappedin/core-sdk';
2811
+ *
2812
+ * // Must be called before initializing any maps
2813
+ * setWorkerUrl('https://cdn.example.com/workers/collision-worker.js');
2814
+ * ```
2815
+ *
2816
+ * @remarks
2817
+ * - This function must be called before any map instances are created
2818
+ * - The worker file must be built and hosted separately as part of your deployment process
2819
+ * - Ideal for applications that need to comply with strict CSP requirements
2820
+ */
2821
+ export function setCollisionWorkerUrl(url: string): void;
2725
2822
  export type { WatermarkUpdateOptions, WatermarkOptions, WatermarkPosition } from '@mappedin/mappedin-js/geojson/src/systems/watermark/system';
2726
2823
  export type { CameraSystemState } from '@mappedin/mappedin-js/geojson/src/systems/camera/system';
2727
2824
  export type { PanBounds } from '@mappedin/mappedin-js/geojson/src/systems/camera/types';
2728
2825
  export { preloadFont, configureWorker } from '@mappedin/mappedin-js/geojson/src/systems/text3d/system';
2729
- export { setWorkerUrl as setCollisionWorkerUrl } from '@mappedin/mappedin-js/geojson/src/systems/collisions/system';
2730
2826
  export type { GLTFExportOptions } from '@mappedin/mappedin-js/geojson/src/systems/exporter';
2731
2827
  export type { AttributionControlOptions, AttributionPosition } from '@mappedin/mappedin-js/geojson/src/systems/html-controls/system';
2732
2828
  export type { Text3DStyle, ModelStyle } from '@mappedin/mappedin-js/geojson/src/components/styles';
@@ -2735,7 +2831,7 @@ declare module '@mappedin/mappedin-js/geojson/src' {
2735
2831
  export { ANIMATION_TWEENS } from '@mappedin/mappedin-js/geojson/src/camera';
2736
2832
  export type { AddPathOptions, AddMarkerOptions, AddLabelOptions, AnimateToOptions, FocusOnOptions, MapViewState, MarkerState, PathState, GroupContainerState, GeometryGroupState, ShapeState, CustomGeometryBuilder, LabelState, GeometryState, ModelState, UpdateModelState, InitializeModelState, Camera, InsetPadding, InsetPaddingOption, Position, ClickPayload, HoverPayload, CameraPayload, MapEvent, MapEventPayload, CollisionRankingTier, LabelAppearance, RendererCore, EnvMapOptions, RendererCoreOptions, Interpolation, };
2737
2833
  export function createRenderer(container: HTMLElement, options?: RendererCoreOptions & {
2738
- [key: string]: any;
2834
+ [key: string]: any;
2739
2835
  }): Promise<RendererCore>;
2740
2836
  }
2741
2837
 
@@ -2745,7 +2841,6 @@ declare module '@mappedin/mappedin-js/mappedin-js/src/maplibre-overlay' {
2745
2841
  import { type TShow3DMapOptions } from '@mappedin/mappedin-js/mappedin-js/src';
2746
2842
  import type { Position } from '@mappedin/core-sdk';
2747
2843
  import type { IControl } from '@packages/internal/outdoor-context-v4';
2748
- import { PubSub } from '@packages/internal/common';
2749
2844
  export type TMappedinMapLibreOverlayEvents = {
2750
2845
  /**
2751
2846
  * Event emitted when the MappedinMap is loaded
@@ -2814,7 +2909,7 @@ declare module '@mappedin/mappedin-js/mappedin-js/src/maplibre-overlay' {
2814
2909
  *
2815
2910
  * Refer to the [Mappedin MapLibre Overlay](https://developer.mappedin.com/web-sdk/mappedin-maplibre-overlay) for more information and interactive examples.
2816
2911
  */
2817
- export class MappedinMapLibreOverlay extends PubSub<TMappedinMapLibreOverlayEvents> implements IControl {
2912
+ export class MappedinMapLibreOverlay implements IControl {
2818
2913
  #private;
2819
2914
  static instance: MappedinMapLibreOverlay;
2820
2915
  /** @internal */
@@ -4130,7 +4225,7 @@ declare module '@mappedin/mappedin-js/mappedin-js/src/constants' {
4130
4225
 
4131
4226
  declare module '@mappedin/mappedin-js/mappedin-js/src/api-geojson/blue-dot/blue-dot' {
4132
4227
  import type { RendererCore } from '@mappedin/core-sdk';
4133
- import { PubSub, EasingCurve } from '@packages/internal/common';
4228
+ import { EasingCurve } from '@packages/internal/common';
4134
4229
  import { Coordinate, type Floor } from '@mappedin/mappedin-js/mappedin-js/src/map-data-objects';
4135
4230
  import type { TBlueDotOptions, TBlueDotPositionUpdate } from '@mappedin/mappedin-js/mappedin-js/src/types';
4136
4231
  import type { GeoJsonApi } from '@mappedin/mappedin-js/mappedin-js/src/api-geojson/api';
@@ -4138,7 +4233,7 @@ declare module '@mappedin/mappedin-js/mappedin-js/src/api-geojson/blue-dot/blue-
4138
4233
  /**
4139
4234
  * Emitted when the Blue Dot's position is updated.
4140
4235
  */
4141
- 'position-update': {
4236
+ 'blue-dot-position-update': {
4142
4237
  floor: Floor | undefined;
4143
4238
  heading: GeolocationPosition['coords']['heading'] | undefined;
4144
4239
  accuracy: GeolocationPosition['coords']['accuracy'] | undefined;
@@ -4147,7 +4242,7 @@ declare module '@mappedin/mappedin-js/mappedin-js/src/api-geojson/blue-dot/blue-
4147
4242
  /**
4148
4243
  * Emitted when the Blue Dot's state changes.
4149
4244
  */
4150
- 'state-change': {
4245
+ 'blue-dot-state-change': {
4151
4246
  /**
4152
4247
  * The new state of the Blue Dot.
4153
4248
  */
@@ -4158,13 +4253,13 @@ declare module '@mappedin/mappedin-js/mappedin-js/src/api-geojson/blue-dot/blue-
4158
4253
  action: TBlueDotAction;
4159
4254
  };
4160
4255
  /**
4161
- * Emitted when the Blue Dot encounters an error.
4256
+ * Emitted when the Blue Dot encounters a GeolocationPositionError.
4162
4257
  */
4163
- error: GeolocationPositionError;
4258
+ 'blue-dot-position-error': GeolocationPositionError;
4164
4259
  /**
4165
4260
  * Emitted when the Blue Dot's following state changes.
4166
4261
  */
4167
- 'follow-change': {
4262
+ 'blue-dot-follow-change': {
4168
4263
  /**
4169
4264
  * Whether the Blue Dot is following the user.
4170
4265
  */
@@ -4208,7 +4303,7 @@ declare module '@mappedin/mappedin-js/mappedin-js/src/api-geojson/blue-dot/blue-
4208
4303
  * mapView.BlueDot.follow('position-and-heading', { zoomLevel: 21, pitch: 45 });
4209
4304
  *
4210
4305
  * // Listen for state changes
4211
- * mapView.BlueDot.on('state-change', ({ state, action }) => {
4306
+ * mapView.on('blue-dot-state-change', ({ state, action }) => {
4212
4307
  * console.log('BlueDot state:', state, 'Action:', action);
4213
4308
  * });
4214
4309
  * ```
@@ -4223,7 +4318,7 @@ declare module '@mappedin/mappedin-js/mappedin-js/src/api-geojson/blue-dot/blue-
4223
4318
  *
4224
4319
  * This class is accessed using {@link MapView.BlueDot}.
4225
4320
  */
4226
- export class BlueDot extends PubSub<TBlueDotEvents> {
4321
+ export class BlueDot {
4227
4322
  #private;
4228
4323
  /**
4229
4324
  * The current state of the BlueDot. Can be 'hidden', 'active', 'inactive', or 'disabled'.
@@ -4261,7 +4356,7 @@ declare module '@mappedin/mappedin-js/mappedin-js/src/api-geojson/blue-dot/blue-
4261
4356
  /**
4262
4357
  * @internal
4263
4358
  */
4264
- constructor(core: RendererCore, geoJSONApi: GeoJsonApi);
4359
+ constructor(core: RendererCore, api: GeoJsonApi);
4265
4360
  /**
4266
4361
  * Enable the Blue Dot. It will be hidden until a position is received either from the browser or by calling {@link BlueDot.update}.
4267
4362
  * @param options - The options to setup the Blue Dot (see {@link TBlueDotOptions}).
@@ -4584,7 +4679,6 @@ declare module '@mappedin/mappedin-js/mappedin-js/src/debug' {
4584
4679
 
4585
4680
  declare module '@mappedin/mappedin-js/mappedin-js/src/navigation' {
4586
4681
  import { type TDirectionInstruction } from '@mappedin/mappedin-js/mappedin-js/src';
4587
- import { PubSub } from '@mappedin/mappedin-js/packages/common/pubsub';
4588
4682
  import type { Directions, GeoJsonApi } from '@mappedin/mappedin-js/mappedin-js/src/api-geojson';
4589
4683
  import type { GeojsonApiMapObject } from '@mappedin/mappedin-js/mappedin-js/src/api-geojson/map-object';
4590
4684
  import type { Floor, FloorStack } from '@mappedin/mappedin-js/mappedin-js/src/map-data-objects';
@@ -4770,6 +4864,21 @@ declare module '@mappedin/mappedin-js/mappedin-js/src/navigation' {
4770
4864
  * Emitted when the navigation state changes.
4771
4865
  */
4772
4866
  'navigation-state-change': NavigationState;
4867
+ /**
4868
+ * Emitted when a connection point is clicked.
4869
+ */
4870
+ 'navigation-connection-click': {
4871
+ fromFloor?: Floor;
4872
+ toFloor: Floor;
4873
+ instruction: TDirectionInstruction;
4874
+ };
4875
+ /**
4876
+ * Emitted when the active path changes.
4877
+ */
4878
+ 'navigation-active-path-change': {
4879
+ directions: Directions;
4880
+ path: Path;
4881
+ };
4773
4882
  };
4774
4883
  /**
4775
4884
  * When a user needs to get from point A to point B, drawing a path on the map helps them to navigate to their destination. It can help them to visualize the route they'll need to take, like a good treasure map.
@@ -4782,7 +4891,7 @@ declare module '@mappedin/mappedin-js/mappedin-js/src/navigation' {
4782
4891
  *
4783
4892
  * Refer to the [Drawing Navigation](https://developer.mappedin.com/web-sdk/wayfinding#drawing-navigation) in the Wayfinding Guide for more information and interactive examples.
4784
4893
  */
4785
- export class Navigation extends PubSub<TNavigationEvents> {
4894
+ export class Navigation {
4786
4895
  #private;
4787
4896
  /**
4788
4897
  * @internal
@@ -4863,6 +4972,7 @@ declare module '@mappedin/mappedin-js/mappedin-js/src/navigation' {
4863
4972
 
4864
4973
  declare module '@mappedin/mappedin-js/mappedin-js/src/api-geojson/api' {
4865
4974
  import type { RendererCore, WatermarkUpdateOptions } from '@mappedin/core-sdk';
4975
+ import { PubSub } from '@packages/internal/common';
4866
4976
  import { type TShow3DMapOptions } from '@mappedin/mappedin-js/mappedin-js/src';
4867
4977
  import { WALLS, DOORS } from '@mappedin/mappedin-js/mappedin-js/src/types';
4868
4978
  import type MapData from '@mappedin/mappedin-js/mappedin-js/src/map-data';
@@ -4871,7 +4981,7 @@ declare module '@mappedin/mappedin-js/mappedin-js/src/api-geojson/api' {
4871
4981
  import type { MapView } from '@mappedin/mappedin-js/mappedin-js/src/map-view';
4872
4982
  import { Label, Marker, Shape } from '@mappedin/mappedin-js/mappedin-js/src/map-view-objects';
4873
4983
  import { Text3D as Text3DView, Model, Path, type Image } from '@mappedin/mappedin-js/mappedin-js/src/map-view-objects';
4874
- import { Navigation } from '@mappedin/mappedin-js/mappedin-js/src/navigation';
4984
+ import { Navigation, type TNavigationEvents } from '@mappedin/mappedin-js/mappedin-js/src/navigation';
4875
4985
  import type { TGetState, TUpdateState } from '@mappedin/mappedin-js/mappedin-js/src/types';
4876
4986
  import { Camera } from '@mappedin/mappedin-js/mappedin-js/src/api-geojson/camera';
4877
4987
  import { Exporter } from '@mappedin/mappedin-js/mappedin-js/src/api-geojson/exporter';
@@ -4881,9 +4991,9 @@ declare module '@mappedin/mappedin-js/mappedin-js/src/api-geojson/api' {
4881
4991
  import { Images } from '@mappedin/mappedin-js/mappedin-js/src/api-geojson/images';
4882
4992
  import { Models } from '@mappedin/mappedin-js/mappedin-js/src/api-geojson/models';
4883
4993
  import { Paths } from '@mappedin/mappedin-js/mappedin-js/src/api-geojson/paths';
4884
- import type { BlueDotState } from '@mappedin/mappedin-js/mappedin-js/src/api-geojson/blue-dot';
4994
+ import type { BlueDotState, TBlueDotEvents } from '@mappedin/mappedin-js/mappedin-js/src/api-geojson/blue-dot';
4885
4995
  import { BlueDot } from '@mappedin/mappedin-js/mappedin-js/src/api-geojson/blue-dot';
4886
- import type { TFloorChangeReason } from '@mappedin/mappedin-js/mappedin-js/src/events';
4996
+ import type { TEvents, TFloorChangeReason } from '@mappedin/mappedin-js/mappedin-js/src/events';
4887
4997
  import { Shapes } from '@mappedin/mappedin-js/mappedin-js/src/api-geojson/shapes';
4888
4998
  import { Style } from '@mappedin/mappedin-js/mappedin-js/src/api-geojson/style';
4889
4999
  import Outdoor from '@mappedin/mappedin-js/mappedin-js/src/api-geojson/outdoor';
@@ -4891,7 +5001,7 @@ declare module '@mappedin/mappedin-js/mappedin-js/src/api-geojson/api' {
4891
5001
  import { Text3D } from '@mappedin/mappedin-js/mappedin-js/src/api-geojson/text3d';
4892
5002
  import { PathSegment } from '@mappedin/mappedin-js/mappedin-js/src/map-view-objects/path';
4893
5003
  import { Tween } from '@tweenjs/tween.js';
4894
- export class GeoJsonApi {
5004
+ export class GeoJsonApi extends PubSub<TBlueDotEvents & TNavigationEvents> {
4895
5005
  #private;
4896
5006
  core: RendererCore;
4897
5007
  mapObjects: GeojsonApiMapObject[];
@@ -4907,6 +5017,13 @@ declare module '@mappedin/mappedin-js/mappedin-js/src/api-geojson/api' {
4907
5017
  layers: string[]
4908
5018
  ][];
4909
5019
  mapView: MapView;
5020
+ /**
5021
+ * External event bus for MapView - bridges internal API events to public API.
5022
+ *
5023
+ * Internal systems publish events here which are then exposed to developers via
5024
+ * MapView.on() and MapView.off().
5025
+ */
5026
+ externalPubSub: PubSub<TEvents>;
4910
5027
  get manualFloorVisibility(): boolean;
4911
5028
  set manualFloorVisibility(value: boolean);
4912
5029
  Camera: Camera;
@@ -4923,7 +5040,7 @@ declare module '@mappedin/mappedin-js/mappedin-js/src/api-geojson/api' {
4923
5040
  Style: Style;
4924
5041
  Images: Images;
4925
5042
  get StackedMaps(): import("..").StackedMaps;
4926
- constructor(rendererCore: RendererCore, mapView: MapView);
5043
+ constructor(rendererCore: RendererCore, mapView: MapView, externalPubSub: PubSub<TEvents>);
4927
5044
  preloadFloors(floors: Floor[]): void;
4928
5045
  updateState<T extends Space | Text3DView | MapObject | Label | Shape | Marker | Model | Door | Facade | Floor | WALLS | DOORS | Path | PathSegment | (string & NonNullable<unknown>)>(target: T, state: TUpdateState<T>): void;
4929
5046
  update: () => void;
@@ -5264,14 +5381,13 @@ declare module '@mappedin/mappedin-js/mappedin-js/src/api-geojson/blue-dot' {
5264
5381
 
5265
5382
  declare module '@mappedin/mappedin-js/mappedin-js/src' {
5266
5383
  import MapData from '@mappedin/mappedin-js/mappedin-js/src/map-data';
5267
- import type { TEvents, TStateChangedInternalPayload, TEventPayload, TClickPayload, THoverPayload, TFloorChangeReason } from '@mappedin/mappedin-js/mappedin-js/src/events';
5384
+ import type { TEvents, TMapDataEvents, TStateChangedInternalPayload, TEventPayload, TClickPayload, THoverPayload, TFloorChangeReason } from '@mappedin/mappedin-js/mappedin-js/src/events';
5268
5385
  import type { TGetMapDataOptions, TGetMapDataWithAccessTokenOptions, TGetMapDataWithCredentialsOptions, TGetMapDataSharedOptions, Environment, TSearchOptions } from '@mappedin/mappedin-js/packages/mvf-utils';
5269
5386
  import { parseMVF, unzipMVF } from '@packages/internal/mvf-utils';
5270
5387
  import type { Floor } from '@mappedin/mappedin-js/mappedin-js/src/map-data-objects';
5271
5388
  import type { ParsedMVF as TMVF, StyleCollection as TMVFStyleCollection, Style as TMVFStyle, LineStringStyle as TMVFLineStringStyle, PolygonStyle as TMVFPolygonStyle, PointStyle as TMVFPointStyle, OperationHours, SiblingGroup, LocationState } from '@mappedin/mvf-v2';
5272
5389
  import { MapView } from '@mappedin/mappedin-js/mappedin-js/src/map-view';
5273
5390
  export type { Text3D as Text3DApi } from '@mappedin/mappedin-js/mappedin-js/src/api-geojson/text3d';
5274
- export { disableText3DWorker } from '@mappedin/mappedin-js/mappedin-js/src/api-geojson/text3d';
5275
5391
  import type { InsetPadding, InsetPaddingOption, Shading, PaintStyle, LineStyle, Text3DState, AddText3DOptions, UpdatableText3DState, InitializeText3DState, EnvMapOptions, MapViewState, UpdateModelState, InitializeModelState, WatermarkUpdateOptions, Interpolation } from '@mappedin/mappedin-js/geojson/src';
5276
5392
  import { enableTestMode, preloadFont } from '@mappedin/mappedin-js/geojson/src';
5277
5393
  export type { PubSub } from '@packages/internal/common/pubsub';
@@ -5284,6 +5400,7 @@ declare module '@mappedin/mappedin-js/mappedin-js/src' {
5284
5400
  import type { TBlueDotEvents, TBlueDotAction, TBlueDotState, GeolocationPositionExtended, TFollowMode, TFollowCameraOptions } from '@mappedin/mappedin-js/mappedin-js/src/api-geojson/blue-dot/blue-dot';
5285
5401
  import type { TExpandOptions, TStackedMapsEvents, TStackedMapsState } from '@mappedin/mappedin-js/mappedin-js/src/api-geojson/stacked-maps/stacked-maps';
5286
5402
  import { hydrateMapData, type THydrateMapDataBundle } from '@mappedin/mappedin-js/mappedin-js/src/hydrate-map-data';
5403
+ export { disableText3DWorker } from '@mappedin/mappedin-js/mappedin-js/src/api-geojson/text3d';
5287
5404
  export { hydrateMapData, type THydrateMapDataBundle };
5288
5405
  export { setLoggerLevel, E_SDK_LOG_LEVEL } from '@packages/internal/common/Mappedin.Logger';
5289
5406
  /**
@@ -5554,6 +5671,15 @@ declare module '@mappedin/mappedin-js/mappedin-js/src' {
5554
5671
  * @default false
5555
5672
  */
5556
5673
  hideImagesNotOnCurrentFloor?: boolean;
5674
+ /**
5675
+ * If true, the map will not use web workers. This will turn off outdoor context, and may negatively impact performance of labels and markers.
5676
+ * @internal
5677
+ *
5678
+ * ⚠️ **WARNING**: Setting this to true is not recommended and should only be used for environments where the CSP does not allow web workers.
5679
+ * Disabling web workers may significantly degrade performance and disable outdoor map functionality.
5680
+ * @default false
5681
+ */
5682
+ disableWorkers?: boolean;
5557
5683
  };
5558
5684
  /**
5559
5685
  * @internal
@@ -5595,6 +5721,19 @@ declare module '@mappedin/mappedin-js/mappedin-js/src' {
5595
5721
  * @experimental
5596
5722
  */
5597
5723
  export const createMapLibreOverlay: (mapData: MapData, showMapOptions?: TShow3DMapOptions) => MappedinMapLibreOverlay;
5724
+ /**
5725
+ * @internal
5726
+ *
5727
+ * Note: had to add this here to avoid a circular reference when I put it in options
5728
+ * TODO: investigate
5729
+ *
5730
+ * Check if the worker urls are valid
5731
+ * @returns false if workers have not been set, and an object with the worker urls if they are set
5732
+ */
5733
+ export const checkWorkerUrls: () => Promise<false | {
5734
+ collision: boolean;
5735
+ maplibre: boolean;
5736
+ }>;
5598
5737
  export const show3dMap: (el: HTMLElement, mapData: MapData, options?: TShow3DMapOptions) => Promise<MapView>;
5599
5738
  /**
5600
5739
  * @internal
@@ -5602,7 +5741,7 @@ declare module '@mappedin/mappedin-js/mappedin-js/src' {
5602
5741
  */
5603
5742
  export const show3dMapGeojson: (el: HTMLElement, mapData: MapData, options?: TShow3DMapOptions) => Promise<MapView>;
5604
5743
  export { parseMVF, unzipMVF, enableTestMode, preloadFont, MAPPEDIN_COLORS };
5605
- export type { MapView, MapData, MapViewState, MappedinMapLibreOverlay, TMappedinMapLibreOverlayEvents, TBlueDotEvents, TBlueDotAction, TBlueDotState, GeolocationPositionExtended, TStackedMapsEvents, TExpandOptions, TStackedMapsState, TFollowMode, TFollowCameraOptions, TEvents, TStateChangedInternalPayload, TEventPayload, TFloorChangeReason, TClickPayload, THoverPayload, TShow3DMapOptions, TGetMapDataOptions, TGetMapDataWithAccessTokenOptions, TGetMapDataWithCredentialsOptions, TSearchOptions, TGetMapDataSharedOptions, TAntialiasingOptions, TMVF, PaintStyle, LineStyle, EnvMapOptions, Shading, TMVFStyleCollection, TMVFStyle, TMVFLineStringStyle, TMVFPolygonStyle, TMVFPointStyle, Environment, InsetPadding, InsetPaddingOption, OperationHours, SiblingGroup, LocationState, Text3DState, AddText3DOptions, UpdatableText3DState, InitializeText3DState, UpdateModelState, InitializeModelState, Interpolation, };
5744
+ export type { MapView, MapData, MapViewState, MappedinMapLibreOverlay, TMappedinMapLibreOverlayEvents, TBlueDotEvents, TBlueDotAction, TBlueDotState, GeolocationPositionExtended, TStackedMapsEvents, TExpandOptions, TStackedMapsState, TFollowMode, TFollowCameraOptions, TEvents, TMapDataEvents, TStateChangedInternalPayload, TEventPayload, TFloorChangeReason, TClickPayload, THoverPayload, TShow3DMapOptions, TGetMapDataOptions, TGetMapDataWithAccessTokenOptions, TGetMapDataWithCredentialsOptions, TSearchOptions, TGetMapDataSharedOptions, TAntialiasingOptions, TMVF, PaintStyle, LineStyle, EnvMapOptions, Shading, TMVFStyleCollection, TMVFStyle, TMVFLineStringStyle, TMVFPolygonStyle, TMVFPointStyle, Environment, InsetPadding, InsetPaddingOption, OperationHours, SiblingGroup, LocationState, Text3DState, AddText3DOptions, UpdatableText3DState, InitializeText3DState, UpdateModelState, InitializeModelState, Interpolation, };
5606
5745
  export type * from 'geojson';
5607
5746
  export type { TUpdateState, TUpdateStates, TLabelState, TGeometryState, TModelState, TShapeState, TDoorsState, TImageState, TWallsState, TCameraAnimationOptions, TAnimationOptions, TFocusOnOptions, TEasingFunction, TCameraTarget, TNavigationTarget, TDirectionZone, TAddMarkerOptions, TAddPathOptions, TLabelAppearance, TAddLabelOptions, TAddModelOptions, TAddModel, TAddImageOptions, TGetDirectionsOptions, TCollisionRankingTier, TMarkerAnchor, TDirectionInstruction, TDirectionInstructionAction, TGetState, TMarkerState, TBlueDotOptions, TBlueDotPositionUpdate, TFocusTarget, IFocusable, IAnchorable, TMapDataObjectTypes, TFloorState, TFacadeState, TSetFloorOptions, TCancellablePromise, TAnimateStateResult, GlobalState, TActionType, TBearingType, TConnectionType, } from '@mappedin/mappedin-js/mappedin-js/src/types';
5608
5747
  export { WALLS, DOORS, ACTION_TYPE, BEARING_TYPE, CONNECTION_TYPE } from '@mappedin/mappedin-js/mappedin-js/src/types';
@@ -12221,107 +12360,6 @@ declare module '@mappedin/mappedin-js/packages/geojson-navigator' {
12221
12360
  export * from '@mappedin/mappedin-js/packages/geojson-navigator/src';
12222
12361
  }
12223
12362
 
12224
- declare module '@mappedin/mappedin-js/geojson/src/utils' {
12225
- import type { Object3D, PerspectiveCamera, Camera as THREECamera } from 'three';
12226
- import { BoxGeometry, Mesh, MeshBasicMaterial, Box2 } from 'three';
12227
- import { MercatorCoordinate } from '@mappedin/mappedin-js/packages/outdoor-context-v4';
12228
- import type { CustomLayerInterface } from '@mappedin/mappedin-js/packages/outdoor-context-v4';
12229
- import { GroupContainerObject3D } from '@mappedin/mappedin-js/geojson/src/entities/group-container';
12230
- import type { Geometry2D } from '@mappedin/mappedin-js/geojson/src/entities/geometry2d';
12231
- import type { Geometry3DTypes } from '@mappedin/mappedin-js/geojson/src/entities/geometry3d';
12232
- import type { Position, RendererState } from '@mappedin/mappedin-js/geojson/src/renderer';
12233
- import type { Camera } from '@mappedin/mappedin-js/geojson/src/camera';
12234
- import { GeometryGroupObject3D } from '@mappedin/mappedin-js/geojson/src/entities/geometry-group';
12235
- export { isFiniteBox } from '@packages/internal/common';
12236
- import type { Position as GeoJSONPosition } from 'geojson';
12237
- export function cartesianToGeographic(centerLat: number, centerLon: number, x: number, y: number): {
12238
- lat: number;
12239
- lon: number;
12240
- };
12241
- export function geographicToCartesian(centerLat: number, centerLon: number, targetLat: number, targetLon: number): {
12242
- x: number;
12243
- y: number;
12244
- };
12245
- export const populateGeometry3DIdsInScene: (tree: GroupContainerObject3D["children"][0] | Object3D, entities: RendererState["geometry3DIdsInScene"], loadGeometryGroupIds: RendererState["geometryGroupIdsToLoad"]) => Set<string | number>;
12246
- export const populateGeometry2DIdsInScene: (tree: any, entities: Set<Geometry2D["id"]>) => Set<string | number>;
12247
- export function convertMapLibreStylePaintProps(paint: any): {
12248
- color: any;
12249
- height: any;
12250
- altitude: any;
12251
- opacity: any;
12252
- outline: any;
12253
- };
12254
- export function convertMapLibreLineStylePaintProps(paint: any): {
12255
- color: any;
12256
- join: any;
12257
- opacity: any;
12258
- width: any;
12259
- cap: any;
12260
- };
12261
- export function mergeObjects<T extends Record<string, any>>(obj1: T, obj2: T): T;
12262
- export function createCustomLayer(modelAsMercatorCoordinate: MercatorCoordinate, viewCamera: THREECamera, camera: Camera, onRender: () => void): CustomLayerInterface;
12263
- export function getRequestHeaders(authURL: string): Promise<{
12264
- 'x-mappedin-tiles-key': string;
12265
- }>;
12266
- export function cyrb53(str: string, seed?: number): number;
12267
- /**
12268
- /* getProjectionScaleFactor()
12269
- /* finds the scale ratio between screen coordinates and 3D coordinates (in X-Z plane)
12270
- /*
12271
- * R
12272
- * /|
12273
- * C : Camera / |
12274
- * PQ : Projection Plane / |
12275
- * OR : Origin / |
12276
- * F : FOV / |
12277
- * Q / |
12278
- * /| |
12279
- * / | |
12280
- * / | |
12281
- * / | |
12282
- * / | |
12283
- * / F/2 | |
12284
- * C ------------P------------ O
12285
- *
12286
- *
12287
- * ProjectionScaleFactor = ( OR / PQ )
12288
- * PQ = canvasHeight / 2
12289
- * CQ = zoom
12290
- *
12291
- * OR / C0 = tan(F/2)
12292
- * so OR = CO * tan(F/2)
12293
- */
12294
- export function getProjectionScaleFactor(FOV: number, canvasHeight: number, zoom: number): number;
12295
- export function getBoundingBoxCenter(bbox: Position[]): [number, number];
12296
- export { getCornersOfBoundingBox } from '@mappedin/mappedin-js/geojson/src/utils/bounding-box';
12297
- export { getGeometryByGeometryId } from '@mappedin/mappedin-js/geojson/src/utils/ecs';
12298
- export { getPixelRatio } from '@mappedin/mappedin-js/geojson/src/utils/get-pixel-ratio';
12299
- export { debounce } from '@mappedin/mappedin-js/geojson/src/utils/async';
12300
- export { shouldDisableOffscreenCanvas } from '@mappedin/mappedin-js/geojson/src/utils/browser';
12301
- export { noop, pick, isEmpty, type KeysOfUnion } from '@mappedin/mappedin-js/geojson/src/utils/fp';
12302
- export { transformRequest } from '@mappedin/mappedin-js/geojson/src/utils/tranform-request';
12303
- export { normalizeAngle } from '@mappedin/mappedin-js/geojson/src/utils/math';
12304
- export function shouldExpandZoomLevel(minZoomFromCurrentPanBounds: number, cameraZoomLevel: number): boolean;
12305
- export function getGroupContainerOpacity(entity: Geometry3DTypes | GeometryGroupObject3D): number;
12306
- /**
12307
- * Checks if two coordinate arrays are equal within a small tolerance to handle floating point precision issues.
12308
- *
12309
- * @param coord1 - First coordinate [longitude, latitude] or [longitude, latitude, altitude]
12310
- * @param coord2 - Second coordinate [longitude, latitude] or [longitude, latitude, altitude]
12311
- * @param tolerance - Tolerance for floating point comparison (default: 1e-10)
12312
- * @returns True if coordinates are equal within tolerance
12313
- */
12314
- export function coordinatesEqual(coord1: GeoJSONPosition, coord2: GeoJSONPosition, tolerance?: number): boolean;
12315
- export const MAPLIBRE_FRUSTRUM_CULL_HACK_NAME = "maplibre-frustum-culling-hack";
12316
- /**
12317
- * TODO: Find the actual root of the problem and fix it.
12318
- * This is a hack to get around some geometry disappearing when we're added as a layer in maplibre.
12319
- */
12320
- export function maplibreFrustrumCullHack(): Mesh<BoxGeometry, MeshBasicMaterial, import("three").Object3DEventMap>;
12321
- export function projectToBox2D(object: Object3D, camera: PerspectiveCamera, result?: Box2): Box2;
12322
- export function drawProjectedBox(box: Box2, color: string, container: HTMLElement): HTMLDivElement;
12323
- }
12324
-
12325
12363
  declare module '@mappedin/mappedin-js/geojson/src/utils/constants' {
12326
12364
  import type { InsetPadding } from '@mappedin/mappedin-js/geojson/src/types';
12327
12365
  export const DEFAULT_INSET_PADDING: InsetPadding;
@@ -12337,6 +12375,8 @@ declare module '@mappedin/mappedin-js/geojson/src/utils/constants' {
12337
12375
  * Duration of zoom in/out animation when double tapping with one finger or single tapping with two fingers.
12338
12376
  */
12339
12377
  export const TAP_ZOOM_DURATION = 250;
12378
+ export const COLLISION_WORKER_PATH = "collision-worker.csp.js";
12379
+ export const MAPLIBRE_WORKER_PATH = "maplibre-worker.csp.js";
12340
12380
  }
12341
12381
 
12342
12382
  declare module '@mappedin/mappedin-js/geojson/src/utils/debug' {
@@ -13172,8 +13212,9 @@ declare module '@mappedin/mappedin-js/geojson/src/systems/text3d/system' {
13172
13212
  }> {
13173
13213
  textSet: Set<string>;
13174
13214
  batchedTextMap: Map<GroupContainerObject3D, Promise<BatchedText>>;
13215
+ useWorker: boolean;
13175
13216
  remove(id: string): void;
13176
- constructor(rendererState: RendererState, convertTo3DMapPosition: RendererCore['convertTo3DMapPosition']);
13217
+ constructor(rendererState: RendererState, convertTo3DMapPosition: RendererCore['convertTo3DMapPosition'], useWorker?: boolean);
13177
13218
  update(cameraRotationRadians: number): Promise<void[]>;
13178
13219
  showTextAreaMesh(): void;
13179
13220
  hideTextAreaMesh(): void;
@@ -13194,135 +13235,22 @@ declare module '@mappedin/mappedin-js/geojson/src/systems/text3d/system' {
13194
13235
  export const DEFAULT_VERTICAL_OFFSET = 0.5;
13195
13236
  }
13196
13237
 
13197
- declare module '@mappedin/mappedin-js/geojson/src/systems/collisions/system' {
13198
- import { QuadTree } from '@packages/internal/quad-tree';
13199
- import '../../styles/collisions.scss';
13200
- import type { MarkerComponent } from '@mappedin/mappedin-js/geojson/src/components/marker';
13201
- import type LabelComponent from '@mappedin/mappedin-js/geojson/src/components/label';
13202
- import { PubSub } from '@mappedin/mappedin-js/packages/common/pubsub';
13203
- import type { RendererState } from '@mappedin/mappedin-js/geojson/src/renderer';
13204
- import type { TSerializedCollider, TSerializedColliderResponse } from '@mappedin/mappedin-js/geojson/src/systems/collisions/collider-processor';
13205
- import type { WatermarkPosition } from '@mappedin/mappedin-js/geojson/src/systems/watermark/system';
13206
- export type TMessageEvent = MessageEvent<{
13207
- msgId: string;
13208
- colliders: TSerializedColliderResponse[];
13209
- debug: {
13210
- x: number;
13211
- y: number;
13212
- w: number;
13213
- h: number;
13214
- }[];
13215
- }>;
13216
- export type TMessage = {
13217
- msgId: string;
13218
- totalWidth: number;
13219
- totalHeight: number;
13220
- watermarkWidth: number;
13221
- watermarkHeight: number;
13222
- watermarkPosition: WatermarkPosition;
13223
- colliders: TSerializedCollider[];
13224
- devicePixelRatio: number;
13225
- };
13226
- type TCollisionSystemEvent = {
13227
- 'visibility-changed': undefined;
13228
- };
13229
- export type PackedBBox = [x: number, y: number, w: number, h: number, index: number];
13230
- export type PackedBBoxes = PackedBBox[];
13231
- export type PackedCollider = [
13232
- bboxes: PackedBBoxes,
13233
- enabled: 0 | 1,
13234
- alwaysVisible: 0 | 1,
13235
- x: number,
13236
- y: number,
13237
- shouldCollideWithScreenEdges?: 0 | 1,
13238
- onlyExposeStrategyIndex?: number
13239
- ];
13240
- export type PackedMessage = [
13241
- colliders: PackedCollider[],
13242
- devicePixelRatio: number,
13243
- totalHeight: number,
13244
- totalWidth: number,
13245
- watermarkWidth: number,
13246
- watermarkHeight: number,
13247
- watermarkPosition: WatermarkPosition
13248
- ];
13249
- export class CollisionSystem extends PubSub<TCollisionSystemEvent, keyof TCollisionSystemEvent> {
13250
- collidersDirty: boolean;
13251
- packedMessage: PackedMessage;
13252
- visibleCollidersQTree: QuadTree<{
13253
- entityId: string | number;
13254
- }>;
13255
- interactiveCollidersQTree: QuadTree<{
13256
- entityId: string | number;
13257
- }>;
13258
- coreState: RendererState;
13259
- constructor(debugCanvas: HTMLCanvasElement, coreState: RendererState, worker?: Worker);
13260
- postMessage: () => void;
13261
- showCollisionBoxes: () => void;
13262
- hideCollisionBoxes: () => void;
13263
- currentMsgId: string;
13264
- working: boolean;
13265
- componentArray: (MarkerComponent | LabelComponent)[];
13266
- update: (watermarkWidth: number, watermarkHeight: number, watermarkPosition?: WatermarkPosition, isPanning?: boolean) => void;
13267
- resize(watermarkWidth: number, watermarkHeight: number, watermarkPosition: WatermarkPosition): void;
13268
- /**
13269
- * Resolve collisions
13270
- */
13271
- resolve: (e: MessageEvent<{
13272
- msgId: string;
13273
- colliders: TSerializedColliderResponse[];
13274
- }>) => void;
13275
- drawDebug: () => void;
13276
- destroy: () => void;
13277
- }
13278
- /**
13279
- * Sets the URL for the collision system worker script.
13280
- *
13281
- * This function allows specifying a custom URL for the collision system's web worker,
13282
- * which is particularly useful in environments with strict Content Security Policy (CSP)
13283
- * that don't allow blob: URLs or inline scripts.
13284
- *
13285
- * When provided, the collision system will load its worker from the specified URL
13286
- * instead of creating an inline worker from a blob. This enables compatibility with
13287
- * environments that have restrictive CSP settings.
13288
- *
13289
- * @param url - The absolute URL pointing to the collision worker script.
13290
- * This should be a URL where the compiled version of the worker.ts file is hosted.
13291
- *
13292
- * @example
13293
- * ```typescript
13294
- * // Set a custom URL for the collision worker
13295
- * import { setWorkerUrl } from '@mappedin/core-sdk';
13296
- *
13297
- * // Must be called before initializing any maps
13298
- * setWorkerUrl('https://cdn.example.com/workers/collision-worker.js');
13299
- * ```
13300
- *
13301
- * @remarks
13302
- * - This function must be called before any map instances are created
13303
- * - The worker file must be built and hosted separately as part of your deployment process
13304
- * - Ideal for applications that need to comply with strict CSP requirements
13305
- */
13306
- export function setWorkerUrl(url: string): void;
13307
- export {};
13308
- }
13309
-
13310
- declare module '@mappedin/mappedin-js/geojson/src/systems/exporter' {
13311
- export { ExporterSystem, type GLTFExportOptions } from '@mappedin/mappedin-js/geojson/src/systems/exporter/exporter';
13312
- }
13313
-
13314
- declare module '@mappedin/mappedin-js/geojson/src/systems/html-controls/system' {
13315
- import type { Map } from '@mappedin/mappedin-js/packages/outdoor-context-v4';
13316
- import '../../styles/html-controls.scss';
13317
- /**
13318
- * All possible control anchor positions.
13319
- */
13320
- export const ATTRIBUTION_POSITIONS: readonly ["top-left", "top-right", "bottom-left", "bottom-right"];
13321
- export type AttributionPosition = (typeof ATTRIBUTION_POSITIONS)[number];
13322
- export type AttributionControlOptions = {
13323
- custom?: string[];
13324
- position?: AttributionPosition;
13325
- feedback?: boolean;
13238
+ declare module '@mappedin/mappedin-js/geojson/src/systems/exporter' {
13239
+ export { ExporterSystem, type GLTFExportOptions } from '@mappedin/mappedin-js/geojson/src/systems/exporter/exporter';
13240
+ }
13241
+
13242
+ declare module '@mappedin/mappedin-js/geojson/src/systems/html-controls/system' {
13243
+ import type { Map } from '@mappedin/mappedin-js/packages/outdoor-context-v4';
13244
+ import '../../styles/html-controls.scss';
13245
+ /**
13246
+ * All possible control anchor positions.
13247
+ */
13248
+ export const ATTRIBUTION_POSITIONS: readonly ["top-left", "top-right", "bottom-left", "bottom-right"];
13249
+ export type AttributionPosition = (typeof ATTRIBUTION_POSITIONS)[number];
13250
+ export type AttributionControlOptions = {
13251
+ custom?: string[];
13252
+ position?: AttributionPosition;
13253
+ feedback?: boolean;
13326
13254
  };
13327
13255
  export class HTMLControlsSystem {
13328
13256
  controlContainerEl: HTMLDivElement;
@@ -13360,12 +13288,12 @@ declare module '@mappedin/mappedin-js/mappedin-js/src/api-geojson/map-object' {
13360
13288
  import { PubSub } from '@packages/internal/common';
13361
13289
  import type { Position, AddLabelOptions, RendererCore, PathState, MarkerState, LineStyle, PaintStyle, EntityId, Text3DState } from '@mappedin/core-sdk';
13362
13290
  import { FloorObject } from '@mappedin/mappedin-js/mappedin-js/src/api-geojson/floor-object';
13363
- import type { Directions, Floor, TAddMarkerOptions, TAddPathOptions, TShow3DMapOptions } from '@mappedin/mappedin-js/mappedin-js/src';
13364
- import type { GLTFExportOptions, TAnimationOptions, TAddModelOptions, TAddImageOptions, TDirectionInstruction, TAddText3DOptions, IAnchorable, TAddLabelOptions } from '@mappedin/mappedin-js/mappedin-js/src/types';
13291
+ import type { TAddMarkerOptions, TAddPathOptions, TShow3DMapOptions } from '@mappedin/mappedin-js/mappedin-js/src';
13292
+ import type { GLTFExportOptions, TAnimationOptions, TAddModelOptions, TAddImageOptions, TAddText3DOptions, IAnchorable, TAddLabelOptions } from '@mappedin/mappedin-js/mappedin-js/src/types';
13365
13293
  import { type AggregatedStyleMap } from '@mappedin/mappedin-js/mappedin-js/src/api-geojson/utils';
13366
13294
  import { StackedMaps } from '@mappedin/mappedin-js/mappedin-js/src/api-geojson/stacked-maps/stacked-maps';
13367
13295
  import type { TFloorChangeReason } from '@mappedin/mappedin-js/mappedin-js/src/events';
13368
- import type { Path, Shape } from '@mappedin/mappedin-js/mappedin-js/src/map-view-objects';
13296
+ import type { Shape } from '@mappedin/mappedin-js/mappedin-js/src/map-view-objects';
13369
13297
  import type { MapDataInternal } from '@mappedin/mappedin-js/mappedin-js/src/map-data-objects';
13370
13298
  import { Space, Coordinate } from '@mappedin/mappedin-js/mappedin-js/src/map-data-objects';
13371
13299
  import { type GeoJsonApi } from '@mappedin/mappedin-js/mappedin-js/src/api-geojson/api';
@@ -13381,15 +13309,6 @@ declare module '@mappedin/mappedin-js/mappedin-js/src/api-geojson/map-object' {
13381
13309
  floorId: string;
13382
13310
  previousFloorId: string;
13383
13311
  };
13384
- 'navigation-connection-click': {
13385
- fromFloor?: Floor;
13386
- toFloor: Floor;
13387
- instruction: TDirectionInstruction;
13388
- };
13389
- 'navigation-active-path-change': {
13390
- directions: Directions;
13391
- path: Path;
13392
- };
13393
13312
  }> {
13394
13313
  #private;
13395
13314
  floorStacksById: Map<string, FloorStackObject>;
@@ -13760,68 +13679,6 @@ declare module '@mappedin/mappedin-js/mappedin-js/src/map-view-objects/text3d' {
13760
13679
  }
13761
13680
  }
13762
13681
 
13763
- declare module '@mappedin/mappedin-js/packages/common/pubsub' {
13764
- /**
13765
- * Generic PubSub class implementing the Publish-Subscribe pattern for event handling.
13766
- *
13767
- * @template EVENT_PAYLOAD - The type of the event payload.
13768
- * @template EVENT - The type of the event.
13769
- */
13770
- export class PubSub<EVENT_PAYLOAD, EVENT extends keyof EVENT_PAYLOAD = keyof EVENT_PAYLOAD> {
13771
- /**
13772
- * @private
13773
- * @internal
13774
- */
13775
- _subscribers: any;
13776
- /**
13777
- * @private
13778
- * @internal
13779
- */
13780
- publish<EVENT_NAME extends EVENT>(eventName: EVENT_NAME, data?: EVENT_PAYLOAD[EVENT_NAME]): void;
13781
- /**
13782
- * Subscribe a function to an event.
13783
- *
13784
- * @param eventName An event name which, when fired, will call the provided
13785
- * function.
13786
- * @param fn A callback that gets called when the corresponding event is fired. The
13787
- * callback will get passed an argument with a type that's one of event payloads.
13788
- * @example
13789
- * // Subscribe to the 'click' event
13790
- * const handler = (event) => {
13791
- * const { coordinate } = event;
13792
- * const { latitude, longitude } = coordinate;
13793
- * console.log(`Map was clicked at ${latitude}, ${longitude}`);
13794
- * };
13795
- * map.on('click', handler);
13796
- */
13797
- on<EVENT_NAME extends EVENT>(eventName: EVENT_NAME, fn: (payload: EVENT_PAYLOAD[EVENT_NAME] extends {
13798
- data: null;
13799
- } ? EVENT_PAYLOAD[EVENT_NAME]['data'] : EVENT_PAYLOAD[EVENT_NAME]) => void): void;
13800
- /**
13801
- * Unsubscribe a function previously subscribed with {@link on}
13802
- *
13803
- * @param eventName An event name to which the provided function was previously
13804
- * subscribed.
13805
- * @param fn A function that was previously passed to {@link on}. The function must
13806
- * have the same reference as the function that was subscribed.
13807
- * @example
13808
- * // Unsubscribe from the 'click' event
13809
- * const handler = (event) => {
13810
- * console.log('Map was clicked', event);
13811
- * };
13812
- * map.off('click', handler);
13813
- */
13814
- off<EVENT_NAME extends EVENT>(eventName: EVENT_NAME, fn: (payload: EVENT_PAYLOAD[EVENT_NAME] extends {
13815
- data: null;
13816
- } ? EVENT_PAYLOAD[EVENT_NAME]['data'] : EVENT_PAYLOAD[EVENT_NAME]) => void): void;
13817
- /**
13818
- * @private
13819
- * @internal
13820
- */
13821
- destroy(): void;
13822
- }
13823
- }
13824
-
13825
13682
  declare module '@mappedin/mappedin-js/mappedin-js/src/api-geojson/camera' {
13826
13683
  import type { IFocusable, TCameraAnimationOptions, TCameraTarget, TFocusOnOptions, TCameraInteractionsSetOptions } from '@mappedin/mappedin-js/mappedin-js/src/types';
13827
13684
  import type { InsetPadding } from '@mappedin/mappedin-js/geojson/src';
@@ -14853,7 +14710,6 @@ declare module '@mappedin/mappedin-js/mappedin-js/src/api-geojson/outdoor' {
14853
14710
 
14854
14711
  declare module '@mappedin/mappedin-js/mappedin-js/src/navigation/index' {
14855
14712
  import { type TDirectionInstruction } from '@mappedin/mappedin-js/mappedin-js/src';
14856
- import { PubSub } from '@mappedin/mappedin-js/packages/common/pubsub';
14857
14713
  import type { Directions, GeoJsonApi } from '@mappedin/mappedin-js/mappedin-js/src/api-geojson';
14858
14714
  import type { GeojsonApiMapObject } from '@mappedin/mappedin-js/mappedin-js/src/api-geojson/map-object';
14859
14715
  import type { Floor, FloorStack } from '@mappedin/mappedin-js/mappedin-js/src/map-data-objects';
@@ -15039,6 +14895,21 @@ declare module '@mappedin/mappedin-js/mappedin-js/src/navigation/index' {
15039
14895
  * Emitted when the navigation state changes.
15040
14896
  */
15041
14897
  'navigation-state-change': NavigationState;
14898
+ /**
14899
+ * Emitted when a connection point is clicked.
14900
+ */
14901
+ 'navigation-connection-click': {
14902
+ fromFloor?: Floor;
14903
+ toFloor: Floor;
14904
+ instruction: TDirectionInstruction;
14905
+ };
14906
+ /**
14907
+ * Emitted when the active path changes.
14908
+ */
14909
+ 'navigation-active-path-change': {
14910
+ directions: Directions;
14911
+ path: Path;
14912
+ };
15042
14913
  };
15043
14914
  /**
15044
14915
  * When a user needs to get from point A to point B, drawing a path on the map helps them to navigate to their destination. It can help them to visualize the route they'll need to take, like a good treasure map.
@@ -15051,7 +14922,7 @@ declare module '@mappedin/mappedin-js/mappedin-js/src/navigation/index' {
15051
14922
  *
15052
14923
  * Refer to the [Drawing Navigation](https://developer.mappedin.com/web-sdk/wayfinding#drawing-navigation) in the Wayfinding Guide for more information and interactive examples.
15053
14924
  */
15054
- export class Navigation extends PubSub<TNavigationEvents> {
14925
+ export class Navigation {
15055
14926
  #private;
15056
14927
  /**
15057
14928
  * @internal
@@ -15528,9 +15399,14 @@ declare module '@mappedin/mappedin-js/mappedin-js/src/query/external' {
15528
15399
  */
15529
15400
  | 'same-elevation';
15530
15401
  /**
15531
- * The radius to search for features within
15402
+ * The radius to search for features within, only used if useLineOfSight is true
15532
15403
  */
15533
15404
  radius?: number;
15405
+ /**
15406
+ * Whether to use line of sight checks to filter results. This ensures that results aren't obstructed by walls, etc.
15407
+ * @default true
15408
+ */
15409
+ lineOfSight?: boolean;
15534
15410
  /**
15535
15411
  * The types to query for
15536
15412
  */
@@ -15583,12 +15459,20 @@ declare module '@mappedin/mappedin-js/mappedin-js/src/analytics/customer' {
15583
15459
  /**
15584
15460
  * @internal
15585
15461
  */
15586
- sendMapViewLoadedEvent({ firstRenderDuration, dimension, }: {
15462
+ sendMapViewLoadedEvent({ firstRenderDuration, dimension, collisionWorkerDisabled, outdoorsWorkerDisabled, }: {
15587
15463
  firstRenderDuration: number;
15588
15464
  dimension: {
15589
15465
  height: number;
15590
15466
  width: number;
15591
15467
  };
15468
+ /**
15469
+ * True when setWorkerURL is set, but the worker file cannot be found, so we disable the collision worker and use sync collision detection instead
15470
+ */
15471
+ collisionWorkerDisabled: boolean;
15472
+ /**
15473
+ * True when setWorkerURL is set, but the worker file cannot be found, so we disable the outdoor context
15474
+ */
15475
+ outdoorsWorkerDisabled: boolean;
15592
15476
  }): void | Promise<Response> | Promise<void>;
15593
15477
  /**
15594
15478
  * @internal
@@ -15914,6 +15798,90 @@ declare module '@mappedin/mappedin-js/mappedin-js/src/map-data-objects/opening-h
15914
15798
  }
15915
15799
  }
15916
15800
 
15801
+ declare module '@mappedin/mappedin-js/geojson/src/systems/collisions/system' {
15802
+ import { QuadTree } from '@packages/internal/quad-tree';
15803
+ import '../../styles/collisions.scss';
15804
+ import type { MarkerComponent } from '@mappedin/mappedin-js/geojson/src/components/marker';
15805
+ import type LabelComponent from '@mappedin/mappedin-js/geojson/src/components/label';
15806
+ import { PubSub } from '@mappedin/mappedin-js/packages/common/pubsub';
15807
+ import type { RendererState } from '@mappedin/mappedin-js/geojson/src/renderer';
15808
+ import type { TSerializedCollider, TSerializedColliderResponse } from '@mappedin/mappedin-js/geojson/src/systems/collisions/collider-processor';
15809
+ import type { WatermarkPosition } from '@mappedin/mappedin-js/geojson/src/systems/watermark/system';
15810
+ export type TMessageEvent = MessageEvent<{
15811
+ msgId: string;
15812
+ colliders: TSerializedColliderResponse[];
15813
+ debug: {
15814
+ x: number;
15815
+ y: number;
15816
+ w: number;
15817
+ h: number;
15818
+ }[];
15819
+ }>;
15820
+ export type TMessage = {
15821
+ msgId: string;
15822
+ totalWidth: number;
15823
+ totalHeight: number;
15824
+ watermarkWidth: number;
15825
+ watermarkHeight: number;
15826
+ watermarkPosition: WatermarkPosition;
15827
+ colliders: TSerializedCollider[];
15828
+ devicePixelRatio: number;
15829
+ };
15830
+ type TCollisionSystemEvent = {
15831
+ 'visibility-changed': undefined;
15832
+ };
15833
+ export type PackedBBox = [x: number, y: number, w: number, h: number, index: number];
15834
+ export type PackedBBoxes = PackedBBox[];
15835
+ export type PackedCollider = [
15836
+ bboxes: PackedBBoxes,
15837
+ enabled: 0 | 1,
15838
+ alwaysVisible: 0 | 1,
15839
+ x: number,
15840
+ y: number,
15841
+ shouldCollideWithScreenEdges?: 0 | 1,
15842
+ onlyExposeStrategyIndex?: number
15843
+ ];
15844
+ export type PackedMessage = [
15845
+ colliders: PackedCollider[],
15846
+ devicePixelRatio: number,
15847
+ totalHeight: number,
15848
+ totalWidth: number,
15849
+ watermarkWidth: number,
15850
+ watermarkHeight: number,
15851
+ watermarkPosition: WatermarkPosition
15852
+ ];
15853
+ export class CollisionSystem extends PubSub<TCollisionSystemEvent, keyof TCollisionSystemEvent> {
15854
+ collidersDirty: boolean;
15855
+ packedMessage: PackedMessage;
15856
+ visibleCollidersQTree: QuadTree<{
15857
+ entityId: string | number;
15858
+ }>;
15859
+ interactiveCollidersQTree: QuadTree<{
15860
+ entityId: string | number;
15861
+ }>;
15862
+ coreState: RendererState;
15863
+ constructor(debugCanvas: HTMLCanvasElement, coreState: RendererState, useWorker?: boolean);
15864
+ postMessage: () => void;
15865
+ showCollisionBoxes: () => void;
15866
+ hideCollisionBoxes: () => void;
15867
+ currentMsgId: string;
15868
+ working: boolean;
15869
+ componentArray: (MarkerComponent | LabelComponent)[];
15870
+ update: (watermarkWidth: number, watermarkHeight: number, watermarkPosition?: WatermarkPosition, isPanning?: boolean) => void;
15871
+ resize(watermarkWidth: number, watermarkHeight: number, watermarkPosition: WatermarkPosition): void;
15872
+ /**
15873
+ * Resolve collisions
15874
+ */
15875
+ resolve: (e: MessageEvent<{
15876
+ msgId: string;
15877
+ colliders: TSerializedColliderResponse[];
15878
+ }>) => void;
15879
+ drawDebug: () => void;
15880
+ destroy: () => void;
15881
+ }
15882
+ export {};
15883
+ }
15884
+
15917
15885
  declare module '@mappedin/mappedin-js/geojson/src/entities/geometry3d' {
15918
15886
  import { Object3D } from 'three';
15919
15887
  import type { Mesh, Object3DEventMap, ShaderMaterial, Texture, TubeGeometry, Color, Vector2, Raycaster } from 'three';
@@ -16396,6 +16364,8 @@ declare module '@mappedin/mappedin-js/geojson/src/types/options' {
16396
16364
  occlusionEnabled?: boolean;
16397
16365
  /** Callback to intercept and modify requests for images. */
16398
16366
  transformImageRequest?: TransformImageRequest;
16367
+ useWorkers?: boolean;
16368
+ useCollisionWorker?: boolean;
16399
16369
  }>;
16400
16370
  }
16401
16371
 
@@ -16430,6 +16400,68 @@ declare module '@mappedin/mappedin-js/geojson/src/systems/mesh-creation-and-opti
16430
16400
  }
16431
16401
  }
16432
16402
 
16403
+ declare module '@mappedin/mappedin-js/packages/common/pubsub' {
16404
+ /**
16405
+ * Generic PubSub class implementing the Publish-Subscribe pattern for event handling.
16406
+ *
16407
+ * @template EVENT_PAYLOAD - The type of the event payload.
16408
+ * @template EVENT - The type of the event.
16409
+ */
16410
+ export class PubSub<EVENT_PAYLOAD, EVENT extends keyof EVENT_PAYLOAD = keyof EVENT_PAYLOAD> {
16411
+ /**
16412
+ * @private
16413
+ * @internal
16414
+ */
16415
+ _subscribers: any;
16416
+ /**
16417
+ * @private
16418
+ * @internal
16419
+ */
16420
+ publish<EVENT_NAME extends EVENT>(eventName: EVENT_NAME, data?: EVENT_PAYLOAD[EVENT_NAME]): void;
16421
+ /**
16422
+ * Subscribe a function to an event.
16423
+ *
16424
+ * @param eventName An event name which, when fired, will call the provided
16425
+ * function.
16426
+ * @param fn A callback that gets called when the corresponding event is fired. The
16427
+ * callback will get passed an argument with a type that's one of event payloads.
16428
+ * @example
16429
+ * // Subscribe to the 'click' event
16430
+ * const handler = (event) => {
16431
+ * const { coordinate } = event;
16432
+ * const { latitude, longitude } = coordinate;
16433
+ * console.log(`Map was clicked at ${latitude}, ${longitude}`);
16434
+ * };
16435
+ * map.on('click', handler);
16436
+ */
16437
+ on<EVENT_NAME extends EVENT>(eventName: EVENT_NAME, fn: (payload: EVENT_PAYLOAD[EVENT_NAME] extends {
16438
+ data: null;
16439
+ } ? EVENT_PAYLOAD[EVENT_NAME]['data'] : EVENT_PAYLOAD[EVENT_NAME]) => void): void;
16440
+ /**
16441
+ * Unsubscribe a function previously subscribed with {@link on}
16442
+ *
16443
+ * @param eventName An event name to which the provided function was previously
16444
+ * subscribed.
16445
+ * @param fn A function that was previously passed to {@link on}. The function must
16446
+ * have the same reference as the function that was subscribed.
16447
+ * @example
16448
+ * // Unsubscribe from the 'click' event
16449
+ * const handler = (event) => {
16450
+ * console.log('Map was clicked', event);
16451
+ * };
16452
+ * map.off('click', handler);
16453
+ */
16454
+ off<EVENT_NAME extends EVENT>(eventName: EVENT_NAME, fn: (payload: EVENT_PAYLOAD[EVENT_NAME] extends {
16455
+ data: null;
16456
+ } ? EVENT_PAYLOAD[EVENT_NAME]['data'] : EVENT_PAYLOAD[EVENT_NAME]) => void): void;
16457
+ /**
16458
+ * @private
16459
+ * @internal
16460
+ */
16461
+ destroy(): void;
16462
+ }
16463
+ }
16464
+
16433
16465
  declare module '@mappedin/mappedin-js/geojson/src/services/renderer' {
16434
16466
  import type { Scene, Camera } from 'three';
16435
16467
  import { Color, WebGLRenderer } from 'three';
@@ -17067,6 +17099,107 @@ declare module '@mappedin/mappedin-js/geojson/src/systems/geometry-disposal/syst
17067
17099
  }
17068
17100
  }
17069
17101
 
17102
+ declare module '@mappedin/mappedin-js/geojson/src/utils' {
17103
+ import type { Object3D, PerspectiveCamera, Camera as THREECamera } from 'three';
17104
+ import { BoxGeometry, Mesh, MeshBasicMaterial, Box2 } from 'three';
17105
+ import { MercatorCoordinate } from '@mappedin/mappedin-js/packages/outdoor-context-v4';
17106
+ import type { CustomLayerInterface } from '@mappedin/mappedin-js/packages/outdoor-context-v4';
17107
+ import { GroupContainerObject3D } from '@mappedin/mappedin-js/geojson/src/entities/group-container';
17108
+ import type { Geometry2D } from '@mappedin/mappedin-js/geojson/src/entities/geometry2d';
17109
+ import type { Geometry3DTypes } from '@mappedin/mappedin-js/geojson/src/entities/geometry3d';
17110
+ import type { Position, RendererState } from '@mappedin/mappedin-js/geojson/src/renderer';
17111
+ import type { Camera } from '@mappedin/mappedin-js/geojson/src/camera';
17112
+ import { GeometryGroupObject3D } from '@mappedin/mappedin-js/geojson/src/entities/geometry-group';
17113
+ export { isFiniteBox } from '@packages/internal/common';
17114
+ import type { Position as GeoJSONPosition } from 'geojson';
17115
+ export function cartesianToGeographic(centerLat: number, centerLon: number, x: number, y: number): {
17116
+ lat: number;
17117
+ lon: number;
17118
+ };
17119
+ export function geographicToCartesian(centerLat: number, centerLon: number, targetLat: number, targetLon: number): {
17120
+ x: number;
17121
+ y: number;
17122
+ };
17123
+ export const populateGeometry3DIdsInScene: (tree: GroupContainerObject3D["children"][0] | Object3D, entities: RendererState["geometry3DIdsInScene"], loadGeometryGroupIds: RendererState["geometryGroupIdsToLoad"]) => Set<string | number>;
17124
+ export const populateGeometry2DIdsInScene: (tree: any, entities: Set<Geometry2D["id"]>) => Set<string | number>;
17125
+ export function convertMapLibreStylePaintProps(paint: any): {
17126
+ color: any;
17127
+ height: any;
17128
+ altitude: any;
17129
+ opacity: any;
17130
+ outline: any;
17131
+ };
17132
+ export function convertMapLibreLineStylePaintProps(paint: any): {
17133
+ color: any;
17134
+ join: any;
17135
+ opacity: any;
17136
+ width: any;
17137
+ cap: any;
17138
+ };
17139
+ export function mergeObjects<T extends Record<string, any>>(obj1: T, obj2: T): T;
17140
+ export function createCustomLayer(modelAsMercatorCoordinate: MercatorCoordinate, viewCamera: THREECamera, camera: Camera, onRender: () => void): CustomLayerInterface;
17141
+ export function getRequestHeaders(authURL: string): Promise<{
17142
+ 'x-mappedin-tiles-key': string;
17143
+ }>;
17144
+ export function cyrb53(str: string, seed?: number): number;
17145
+ /**
17146
+ /* getProjectionScaleFactor()
17147
+ /* finds the scale ratio between screen coordinates and 3D coordinates (in X-Z plane)
17148
+ /*
17149
+ * R
17150
+ * /|
17151
+ * C : Camera / |
17152
+ * PQ : Projection Plane / |
17153
+ * OR : Origin / |
17154
+ * F : FOV / |
17155
+ * Q / |
17156
+ * /| |
17157
+ * / | |
17158
+ * / | |
17159
+ * / | |
17160
+ * / | |
17161
+ * / F/2 | |
17162
+ * C ------------P------------ O
17163
+ *
17164
+ *
17165
+ * ProjectionScaleFactor = ( OR / PQ )
17166
+ * PQ = canvasHeight / 2
17167
+ * CQ = zoom
17168
+ *
17169
+ * OR / C0 = tan(F/2)
17170
+ * so OR = CO * tan(F/2)
17171
+ */
17172
+ export function getProjectionScaleFactor(FOV: number, canvasHeight: number, zoom: number): number;
17173
+ export function getBoundingBoxCenter(bbox: Position[]): [number, number];
17174
+ export { getCornersOfBoundingBox } from '@mappedin/mappedin-js/geojson/src/utils/bounding-box';
17175
+ export { getGeometryByGeometryId } from '@mappedin/mappedin-js/geojson/src/utils/ecs';
17176
+ export { getPixelRatio } from '@mappedin/mappedin-js/geojson/src/utils/get-pixel-ratio';
17177
+ export { debounce } from '@mappedin/mappedin-js/geojson/src/utils/async';
17178
+ export { shouldDisableOffscreenCanvas } from '@mappedin/mappedin-js/geojson/src/utils/browser';
17179
+ export { noop, pick, isEmpty, type KeysOfUnion } from '@mappedin/mappedin-js/geojson/src/utils/fp';
17180
+ export { transformRequest } from '@mappedin/mappedin-js/geojson/src/utils/tranform-request';
17181
+ export { normalizeAngle } from '@mappedin/mappedin-js/geojson/src/utils/math';
17182
+ export function shouldExpandZoomLevel(minZoomFromCurrentPanBounds: number, cameraZoomLevel: number): boolean;
17183
+ export function getGroupContainerOpacity(entity: Geometry3DTypes | GeometryGroupObject3D): number;
17184
+ /**
17185
+ * Checks if two coordinate arrays are equal within a small tolerance to handle floating point precision issues.
17186
+ *
17187
+ * @param coord1 - First coordinate [longitude, latitude] or [longitude, latitude, altitude]
17188
+ * @param coord2 - Second coordinate [longitude, latitude] or [longitude, latitude, altitude]
17189
+ * @param tolerance - Tolerance for floating point comparison (default: 1e-10)
17190
+ * @returns True if coordinates are equal within tolerance
17191
+ */
17192
+ export function coordinatesEqual(coord1: GeoJSONPosition, coord2: GeoJSONPosition, tolerance?: number): boolean;
17193
+ export const MAPLIBRE_FRUSTRUM_CULL_HACK_NAME = "maplibre-frustum-culling-hack";
17194
+ /**
17195
+ * TODO: Find the actual root of the problem and fix it.
17196
+ * This is a hack to get around some geometry disappearing when we're added as a layer in maplibre.
17197
+ */
17198
+ export function maplibreFrustrumCullHack(): Mesh<BoxGeometry, MeshBasicMaterial, import("three").Object3DEventMap>;
17199
+ export function projectToBox2D(object: Object3D, camera: PerspectiveCamera, result?: Box2): Box2;
17200
+ export function drawProjectedBox(box: Box2, color: string, container: HTMLElement): HTMLDivElement;
17201
+ }
17202
+
17070
17203
  declare module '@mappedin/mappedin-js/geojson/src/components/styles/style' {
17071
17204
  import type { LineStyle } from '@mappedin/mappedin-js/geojson/src/renderer';
17072
17205
  export const DEFAULT_COLOR = "#ffffff";
@@ -17133,104 +17266,6 @@ declare module '@mappedin/mappedin-js/packages/geojson-navigator/src' {
17133
17266
  export type { CoordinateFeature, CoordinateProperties } from '@mappedin/mappedin-js/packages/geojson-navigator/src/types/coordinate';
17134
17267
  }
17135
17268
 
17136
- declare module '@mappedin/mappedin-js/geojson/src/utils/bounding-box' {
17137
- import { type Box3, Vector3 } from 'three';
17138
- export function getCornersOfBoundingBox(boundingBox: Box3): Vector3[];
17139
- }
17140
-
17141
- declare module '@mappedin/mappedin-js/geojson/src/utils/ecs' {
17142
- import type { Geometry2D, Geometry3DTypes } from '@mappedin/mappedin-js/geojson/src/entities';
17143
- import type { GroupContainerObject3D } from '@mappedin/mappedin-js/geojson/src/entities/group-container';
17144
- import type { GeometryGroupObject3D } from '@mappedin/mappedin-js/geojson/src/entities/geometry-group';
17145
- import type { EntityId, EntityState, RendererState } from '@mappedin/mappedin-js/geojson/src/renderer';
17146
- import { Box3, Vector3 } from 'three';
17147
- import type RendererCore from '@mappedin/mappedin-js/geojson/src/renderer';
17148
- export function getGeometryByGeometryId(state: RendererState, geometryOrGeometryId?: string | number | Record<string, any>): Geometry3DTypes | GeometryGroupObject3D | GroupContainerObject3D | Geometry2D | undefined;
17149
- export function getVerticesOfEntity(core: RendererCore, geometryOrGeometryId?: string | number | EntityId<EntityState>, vertices?: Vector3[], bounds?: Box3, zOffset?: number): Vector3[];
17150
- }
17151
-
17152
- declare module '@mappedin/mappedin-js/geojson/src/utils/get-pixel-ratio' {
17153
- export function getPixelRatio(): number;
17154
- }
17155
-
17156
- declare module '@mappedin/mappedin-js/geojson/src/utils/async' {
17157
- export function throttle<T>(func: () => void, wait: number, options?: any): () => void;
17158
- export function debounce<T extends (...args: any[]) => void>(func: T, wait: number, immediate?: boolean): (...args: Parameters<T>) => void;
17159
- }
17160
-
17161
- declare module '@mappedin/mappedin-js/geojson/src/utils/browser' {
17162
- type DeviceType = {
17163
- isIpad: boolean;
17164
- isMobile: boolean;
17165
- isSafari12: boolean;
17166
- isFirefox: boolean;
17167
- isWindows: boolean;
17168
- };
17169
- /**
17170
- * Get device OS info
17171
- * export for testing purpose
17172
- * @returns DeviceType
17173
- */
17174
- export const _deviceTypeControl: {
17175
- getDeviceType(): DeviceType;
17176
- _reset(): void;
17177
- };
17178
- export const getDeviceType: () => DeviceType;
17179
- /**
17180
- * Creates a closure encapsulating the logic of getting device GPU info.
17181
- * inspired by https://github.com/pmndrs/detect-gpu
17182
- * export for testing
17183
- */
17184
- export const _gpuInfoControl: {
17185
- getInfo: () => string | undefined;
17186
- shouldDisableOffscreenCanvas: () => boolean;
17187
- _setCanvas(c: HTMLCanvasElement): void;
17188
- };
17189
- export const getGPUInfo: () => string | undefined;
17190
- /**
17191
- * Check if device is certain intel integrated GPU.
17192
- * This is for implementing workaround - https://issues.chromium.org/issues/40251953
17193
- * The reason we want to disable OffscreenCanvas at all is due to `willReadFrequently` flag only works in FF.
17194
- * In order to ensure the integrated intel GPU render text correctly
17195
- */
17196
- export const shouldDisableOffscreenCanvas: () => boolean;
17197
- export {};
17198
- }
17199
-
17200
- declare module '@mappedin/mappedin-js/geojson/src/utils/fp' {
17201
- export function noop(): void;
17202
- export type KeysOfUnion<T> = T extends T ? keyof T : never;
17203
- /**
17204
- * Given an object and a number of properties as strings, return version
17205
- * of that object with only those properties.
17206
- *
17207
- * @param src - the object
17208
- * @param properties - an array of property names chosen
17209
- * to appear on the resulting object.
17210
- * @returns object with limited properties.
17211
- * @example
17212
- * ```ts
17213
- * let foo = { name: 'Charlie', age: 10 };
17214
- * let justName = pick(foo, ['name']); // justName = { name: 'Charlie' }
17215
- * ```
17216
- */
17217
- export function pick<T extends object>(src: T, properties: KeysOfUnion<T>[]): Partial<T>;
17218
- export function isEmpty(obj: Record<string, any>): boolean;
17219
- }
17220
-
17221
- declare module '@mappedin/mappedin-js/geojson/src/utils/tranform-request' {
17222
- export const transformRequest: (headers: {
17223
- "x-mappedin-tiles-key": string;
17224
- }) => (url: string) => {
17225
- url: string;
17226
- headers: {};
17227
- };
17228
- }
17229
-
17230
- declare module '@mappedin/mappedin-js/geojson/src/utils/math' {
17231
- export function normalizeAngle(angle: number): number;
17232
- }
17233
-
17234
17269
  declare module '@mappedin/mappedin-js/geojson/src/entities' {
17235
17270
  export { updateInteractivity } from '@mappedin/mappedin-js/geojson/src/entities/utils';
17236
17271
  export { Geometry2D, Geometry2DComponents } from '@mappedin/mappedin-js/geojson/src/entities/geometry2d';
@@ -17269,35 +17304,6 @@ declare module '@mappedin/mappedin-js/geojson/src/systems/camera/helpers' {
17269
17304
  export * from '@mappedin/mappedin-js/geojson/src/systems/camera/helpers/utils';
17270
17305
  }
17271
17306
 
17272
- declare module '@mappedin/mappedin-js/geojson/src/systems/collisions/collider-processor' {
17273
- import { Rectangle } from '@packages/internal/quad-tree';
17274
- export type TSerializedCollider = {
17275
- rank: number;
17276
- enabledAndVisible: boolean;
17277
- x: number;
17278
- y: number;
17279
- bboxes: {
17280
- index: number;
17281
- boundingBox: [number, number, number, number];
17282
- boundingRect?: Rectangle;
17283
- }[];
17284
- shouldCollideWithScreenEdges?: boolean;
17285
- lockedToStrategyIndex?: number;
17286
- visible?: boolean;
17287
- };
17288
- export type TSerializedColliderResponse = [number, 1 | 0, Rectangle?];
17289
- export function processColliders(colliders: TSerializedCollider[], totalWidth: any, totalHeight: any, watermarkWidth: any, watermarkHeight: any, watermarkPosition: any, msgId?: string): {
17290
- msgId: string;
17291
- colliders: TSerializedColliderResponse[];
17292
- debug: {
17293
- x: number;
17294
- y: number;
17295
- w: number;
17296
- h: number;
17297
- }[];
17298
- };
17299
- }
17300
-
17301
17307
  declare module '@mappedin/mappedin-js/geojson/src/systems/exporter/exporter' {
17302
17308
  import type { RendererState } from '@mappedin/mappedin-js/geojson/src/renderer';
17303
17309
  export type GLTFExportOptions = {
@@ -17764,6 +17770,35 @@ declare module '@mappedin/mappedin-js/mappedin-js/src/api-geojson/directions/uti
17764
17770
  export function getNodesFromTarget(target: TNavigationTarget, mapData: MapDataInternal): string[];
17765
17771
  }
17766
17772
 
17773
+ declare module '@mappedin/mappedin-js/geojson/src/systems/collisions/collider-processor' {
17774
+ import { Rectangle } from '@packages/internal/quad-tree';
17775
+ export type TSerializedCollider = {
17776
+ rank: number;
17777
+ enabledAndVisible: boolean;
17778
+ x: number;
17779
+ y: number;
17780
+ bboxes: {
17781
+ index: number;
17782
+ boundingBox: [number, number, number, number];
17783
+ boundingRect?: Rectangle;
17784
+ }[];
17785
+ shouldCollideWithScreenEdges?: boolean;
17786
+ lockedToStrategyIndex?: number;
17787
+ visible?: boolean;
17788
+ };
17789
+ export type TSerializedColliderResponse = [number, 1 | 0, Rectangle?];
17790
+ export function processColliders(colliders: TSerializedCollider[], totalWidth: any, totalHeight: any, watermarkWidth: any, watermarkHeight: any, watermarkPosition: any, msgId?: string): {
17791
+ msgId: string;
17792
+ colliders: TSerializedColliderResponse[];
17793
+ debug: {
17794
+ x: number;
17795
+ y: number;
17796
+ w: number;
17797
+ h: number;
17798
+ }[];
17799
+ };
17800
+ }
17801
+
17767
17802
  declare module '@mappedin/mappedin-js/geojson/src/components/outline' {
17768
17803
  import type { BufferAttribute, BufferGeometry } from 'three';
17769
17804
  type Outline = {
@@ -25776,6 +25811,104 @@ declare module '@mappedin/mappedin-js/geojson/src/systems/path/system' {
25776
25811
  }
25777
25812
  }
25778
25813
 
25814
+ declare module '@mappedin/mappedin-js/geojson/src/utils/bounding-box' {
25815
+ import { type Box3, Vector3 } from 'three';
25816
+ export function getCornersOfBoundingBox(boundingBox: Box3): Vector3[];
25817
+ }
25818
+
25819
+ declare module '@mappedin/mappedin-js/geojson/src/utils/ecs' {
25820
+ import type { Geometry2D, Geometry3DTypes } from '@mappedin/mappedin-js/geojson/src/entities';
25821
+ import type { GroupContainerObject3D } from '@mappedin/mappedin-js/geojson/src/entities/group-container';
25822
+ import type { GeometryGroupObject3D } from '@mappedin/mappedin-js/geojson/src/entities/geometry-group';
25823
+ import type { EntityId, EntityState, RendererState } from '@mappedin/mappedin-js/geojson/src/renderer';
25824
+ import { Box3, Vector3 } from 'three';
25825
+ import type RendererCore from '@mappedin/mappedin-js/geojson/src/renderer';
25826
+ export function getGeometryByGeometryId(state: RendererState, geometryOrGeometryId?: string | number | Record<string, any>): Geometry3DTypes | GeometryGroupObject3D | GroupContainerObject3D | Geometry2D | undefined;
25827
+ export function getVerticesOfEntity(core: RendererCore, geometryOrGeometryId?: string | number | EntityId<EntityState>, vertices?: Vector3[], bounds?: Box3, zOffset?: number): Vector3[];
25828
+ }
25829
+
25830
+ declare module '@mappedin/mappedin-js/geojson/src/utils/get-pixel-ratio' {
25831
+ export function getPixelRatio(): number;
25832
+ }
25833
+
25834
+ declare module '@mappedin/mappedin-js/geojson/src/utils/async' {
25835
+ export function throttle<T>(func: () => void, wait: number, options?: any): () => void;
25836
+ export function debounce<T extends (...args: any[]) => void>(func: T, wait: number, immediate?: boolean): (...args: Parameters<T>) => void;
25837
+ }
25838
+
25839
+ declare module '@mappedin/mappedin-js/geojson/src/utils/browser' {
25840
+ type DeviceType = {
25841
+ isIpad: boolean;
25842
+ isMobile: boolean;
25843
+ isSafari12: boolean;
25844
+ isFirefox: boolean;
25845
+ isWindows: boolean;
25846
+ };
25847
+ /**
25848
+ * Get device OS info
25849
+ * export for testing purpose
25850
+ * @returns DeviceType
25851
+ */
25852
+ export const _deviceTypeControl: {
25853
+ getDeviceType(): DeviceType;
25854
+ _reset(): void;
25855
+ };
25856
+ export const getDeviceType: () => DeviceType;
25857
+ /**
25858
+ * Creates a closure encapsulating the logic of getting device GPU info.
25859
+ * inspired by https://github.com/pmndrs/detect-gpu
25860
+ * export for testing
25861
+ */
25862
+ export const _gpuInfoControl: {
25863
+ getInfo: () => string | undefined;
25864
+ shouldDisableOffscreenCanvas: () => boolean;
25865
+ _setCanvas(c: HTMLCanvasElement): void;
25866
+ };
25867
+ export const getGPUInfo: () => string | undefined;
25868
+ /**
25869
+ * Check if device is certain intel integrated GPU.
25870
+ * This is for implementing workaround - https://issues.chromium.org/issues/40251953
25871
+ * The reason we want to disable OffscreenCanvas at all is due to `willReadFrequently` flag only works in FF.
25872
+ * In order to ensure the integrated intel GPU render text correctly
25873
+ */
25874
+ export const shouldDisableOffscreenCanvas: () => boolean;
25875
+ export {};
25876
+ }
25877
+
25878
+ declare module '@mappedin/mappedin-js/geojson/src/utils/fp' {
25879
+ export function noop(): void;
25880
+ export type KeysOfUnion<T> = T extends T ? keyof T : never;
25881
+ /**
25882
+ * Given an object and a number of properties as strings, return version
25883
+ * of that object with only those properties.
25884
+ *
25885
+ * @param src - the object
25886
+ * @param properties - an array of property names chosen
25887
+ * to appear on the resulting object.
25888
+ * @returns object with limited properties.
25889
+ * @example
25890
+ * ```ts
25891
+ * let foo = { name: 'Charlie', age: 10 };
25892
+ * let justName = pick(foo, ['name']); // justName = { name: 'Charlie' }
25893
+ * ```
25894
+ */
25895
+ export function pick<T extends object>(src: T, properties: KeysOfUnion<T>[]): Partial<T>;
25896
+ export function isEmpty(obj: Record<string, any>): boolean;
25897
+ }
25898
+
25899
+ declare module '@mappedin/mappedin-js/geojson/src/utils/tranform-request' {
25900
+ export const transformRequest: (headers: {
25901
+ "x-mappedin-tiles-key": string;
25902
+ }) => (url: string) => {
25903
+ url: string;
25904
+ headers: {};
25905
+ };
25906
+ }
25907
+
25908
+ declare module '@mappedin/mappedin-js/geojson/src/utils/math' {
25909
+ export function normalizeAngle(angle: number): number;
25910
+ }
25911
+
25779
25912
  declare module '@mappedin/mappedin-js/packages/geojson-navigator/src/navigator' {
25780
25913
  export * from '@mappedin/mappedin-js/packages/geojson-navigator/src/navigator/navigator';
25781
25914
  }
@@ -25854,6 +25987,7 @@ declare module '@mappedin/mappedin-js/packages/geojson-navigator/src/navigator/n
25854
25987
  multiplicativeDistanceWeightScaling?: boolean;
25855
25988
  overrideEdgeWeights?: Map<Edge, number>;
25856
25989
  }): DirectionsCollection;
25990
+ hasLineOfSight: (origin: [number, number], destination: [number, number], floorId: string, bufferRadius?: number) => boolean;
25857
25991
  /**
25858
25992
  * Calculates the approximate distance between two geographic coordinates on Earth's surface.
25859
25993
  *