@mappedin/dynamic-focus 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.
@@ -3706,14 +3706,13 @@ declare module '@mappedin/dynamic-focus/mappedin-js/src/api-geojson/directions'
3706
3706
 
3707
3707
  declare module '@mappedin/dynamic-focus/mappedin-js/src' {
3708
3708
  import MapData from '@mappedin/dynamic-focus/mappedin-js/src/map-data';
3709
- import type { TEvents, TStateChangedInternalPayload, TEventPayload, TClickPayload, THoverPayload, TFloorChangeReason } from '@mappedin/dynamic-focus/mappedin-js/src/events';
3709
+ import type { TEvents, TMapDataEvents, TStateChangedInternalPayload, TEventPayload, TClickPayload, THoverPayload, TFloorChangeReason } from '@mappedin/dynamic-focus/mappedin-js/src/events';
3710
3710
  import type { TGetMapDataOptions, TGetMapDataWithAccessTokenOptions, TGetMapDataWithCredentialsOptions, TGetMapDataSharedOptions, Environment, TSearchOptions } from '@mappedin/dynamic-focus/packages/mvf-utils';
3711
3711
  import { parseMVF, unzipMVF } from '@packages/internal/mvf-utils';
3712
3712
  import type { Floor } from '@mappedin/dynamic-focus/mappedin-js/src/map-data-objects';
3713
3713
  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';
3714
3714
  import { MapView } from '@mappedin/dynamic-focus/mappedin-js/src/map-view';
3715
3715
  export type { Text3D as Text3DApi } from '@mappedin/dynamic-focus/mappedin-js/src/api-geojson/text3d';
3716
- export { disableText3DWorker } from '@mappedin/dynamic-focus/mappedin-js/src/api-geojson/text3d';
3717
3716
  import type { InsetPadding, InsetPaddingOption, Shading, PaintStyle, LineStyle, Text3DState, AddText3DOptions, UpdatableText3DState, InitializeText3DState, EnvMapOptions, MapViewState, UpdateModelState, InitializeModelState, WatermarkUpdateOptions, Interpolation } from '@mappedin/dynamic-focus/geojson/src';
3718
3717
  import { enableTestMode, preloadFont } from '@mappedin/dynamic-focus/geojson/src';
3719
3718
  export type { PubSub } from '@packages/internal/common/pubsub';
@@ -3726,6 +3725,7 @@ declare module '@mappedin/dynamic-focus/mappedin-js/src' {
3726
3725
  import type { TBlueDotEvents, TBlueDotAction, TBlueDotState, GeolocationPositionExtended, TFollowMode, TFollowCameraOptions } from '@mappedin/dynamic-focus/mappedin-js/src/api-geojson/blue-dot/blue-dot';
3727
3726
  import type { TExpandOptions, TStackedMapsEvents, TStackedMapsState } from '@mappedin/dynamic-focus/mappedin-js/src/api-geojson/stacked-maps/stacked-maps';
3728
3727
  import { hydrateMapData, type THydrateMapDataBundle } from '@mappedin/dynamic-focus/mappedin-js/src/hydrate-map-data';
3728
+ export { disableText3DWorker } from '@mappedin/dynamic-focus/mappedin-js/src/api-geojson/text3d';
3729
3729
  export { hydrateMapData, type THydrateMapDataBundle };
3730
3730
  export { setLoggerLevel, E_SDK_LOG_LEVEL } from '@packages/internal/common/Mappedin.Logger';
3731
3731
  /**
@@ -3996,6 +3996,15 @@ declare module '@mappedin/dynamic-focus/mappedin-js/src' {
3996
3996
  * @default false
3997
3997
  */
3998
3998
  hideImagesNotOnCurrentFloor?: boolean;
3999
+ /**
4000
+ * If true, the map will not use web workers. This will turn off outdoor context, and may negatively impact performance of labels and markers.
4001
+ * @internal
4002
+ *
4003
+ * ⚠️ **WARNING**: Setting this to true is not recommended and should only be used for environments where the CSP does not allow web workers.
4004
+ * Disabling web workers may significantly degrade performance and disable outdoor map functionality.
4005
+ * @default false
4006
+ */
4007
+ disableWorkers?: boolean;
3999
4008
  };
4000
4009
  /**
4001
4010
  * @internal
@@ -4037,6 +4046,19 @@ declare module '@mappedin/dynamic-focus/mappedin-js/src' {
4037
4046
  * @experimental
4038
4047
  */
4039
4048
  export const createMapLibreOverlay: (mapData: MapData, showMapOptions?: TShow3DMapOptions) => MappedinMapLibreOverlay;
4049
+ /**
4050
+ * @internal
4051
+ *
4052
+ * Note: had to add this here to avoid a circular reference when I put it in options
4053
+ * TODO: investigate
4054
+ *
4055
+ * Check if the worker urls are valid
4056
+ * @returns false if workers have not been set, and an object with the worker urls if they are set
4057
+ */
4058
+ export const checkWorkerUrls: () => Promise<false | {
4059
+ collision: boolean;
4060
+ maplibre: boolean;
4061
+ }>;
4040
4062
  export const show3dMap: (el: HTMLElement, mapData: MapData, options?: TShow3DMapOptions) => Promise<MapView>;
4041
4063
  /**
4042
4064
  * @internal
@@ -4044,7 +4066,7 @@ declare module '@mappedin/dynamic-focus/mappedin-js/src' {
4044
4066
  */
4045
4067
  export const show3dMapGeojson: (el: HTMLElement, mapData: MapData, options?: TShow3DMapOptions) => Promise<MapView>;
4046
4068
  export { parseMVF, unzipMVF, enableTestMode, preloadFont, MAPPEDIN_COLORS };
4047
- 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, };
4069
+ 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, };
4048
4070
  export type * from 'geojson';
4049
4071
  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/dynamic-focus/mappedin-js/src/types';
4050
4072
  export { WALLS, DOORS, ACTION_TYPE, BEARING_TYPE, CONNECTION_TYPE } from '@mappedin/dynamic-focus/mappedin-js/src/types';
@@ -4323,22 +4345,53 @@ declare module '@mappedin/dynamic-focus/geojson/src' {
4323
4345
  export type { Text3DState } from '@mappedin/dynamic-focus/geojson/src/components/text3d';
4324
4346
  export { TEXT3D_STYLE_UPDATE_PROPS } from '@mappedin/dynamic-focus/geojson/src/entities/utils';
4325
4347
  export { Navigator } from '@mappedin/dynamic-focus/packages/geojson-navigator';
4326
- export { debounce } from '@mappedin/dynamic-focus/geojson/src/utils';
4327
- export { MAPPEDIN_LAYER_ID } from '@mappedin/dynamic-focus/geojson/src/utils/constants';
4348
+ export { interpolate, debounce } from '@packages/internal/common';
4349
+ export { MAPPEDIN_LAYER_ID, MAPLIBRE_WORKER_PATH, COLLISION_WORKER_PATH } from '@mappedin/dynamic-focus/geojson/src/utils/constants';
4328
4350
  export type { DebugState, Debug } from '@mappedin/dynamic-focus/geojson/src/utils/debug';
4329
4351
  /**
4330
- * Enable test mode for the renderer. This will disable the WebGLRenderer and WebGL1Renderer and replace them with a dummy object
4331
- * so you can run tests against it
4332
- */
4352
+ * Enable test mode for the renderer. This will disable the WebGLRenderer and WebGL1Renderer and replace them with a dummy object
4353
+ * so you can run tests against it
4354
+ */
4333
4355
  export { enableTestMode } from '@mappedin/dynamic-focus/geojson/src/services/test-mode';
4334
4356
  export { mountSceneGraphVisualizer };
4335
4357
  export type { EntityId, EntityState, LineStyle, PaintStyle, ModelProperties, Shading, ImagePlacementOptions, } from '@mappedin/dynamic-focus/geojson/src/types';
4336
4358
  export type * from 'geojson';
4359
+ export let maplibreWorkerUrl: string;
4360
+ export function setMaplibreWorkerUrl(url: string): void;
4361
+ export let collisionWorkerUrl: string;
4362
+ /**
4363
+ * Sets the URL for the collision system worker script.
4364
+ *
4365
+ * This function allows specifying a custom URL for the collision system's web worker,
4366
+ * which is particularly useful in environments with strict Content Security Policy (CSP)
4367
+ * that don't allow blob: URLs or inline scripts.
4368
+ *
4369
+ * When provided, the collision system will load its worker from the specified URL
4370
+ * instead of creating an inline worker from a blob. This enables compatibility with
4371
+ * environments that have restrictive CSP settings.
4372
+ *
4373
+ * @param url - The absolute URL pointing to the collision worker script.
4374
+ * This should be a URL where the compiled version of the worker.ts file is hosted.
4375
+ *
4376
+ * @example
4377
+ * ```typescript
4378
+ * // Set a custom URL for the collision worker
4379
+ * import { setWorkerUrl } from '@mappedin/core-sdk';
4380
+ *
4381
+ * // Must be called before initializing any maps
4382
+ * setWorkerUrl('https://cdn.example.com/workers/collision-worker.js');
4383
+ * ```
4384
+ *
4385
+ * @remarks
4386
+ * - This function must be called before any map instances are created
4387
+ * - The worker file must be built and hosted separately as part of your deployment process
4388
+ * - Ideal for applications that need to comply with strict CSP requirements
4389
+ */
4390
+ export function setCollisionWorkerUrl(url: string): void;
4337
4391
  export type { WatermarkUpdateOptions, WatermarkOptions, WatermarkPosition } from '@mappedin/dynamic-focus/geojson/src/systems/watermark/system';
4338
4392
  export type { CameraSystemState } from '@mappedin/dynamic-focus/geojson/src/systems/camera/system';
4339
4393
  export type { PanBounds } from '@mappedin/dynamic-focus/geojson/src/systems/camera/types';
4340
4394
  export { preloadFont, configureWorker } from '@mappedin/dynamic-focus/geojson/src/systems/text3d/system';
4341
- export { setWorkerUrl as setCollisionWorkerUrl } from '@mappedin/dynamic-focus/geojson/src/systems/collisions/system';
4342
4395
  export type { GLTFExportOptions } from '@mappedin/dynamic-focus/geojson/src/systems/exporter';
4343
4396
  export type { AttributionControlOptions, AttributionPosition } from '@mappedin/dynamic-focus/geojson/src/systems/html-controls/system';
4344
4397
  export type { Text3DStyle, ModelStyle } from '@mappedin/dynamic-focus/geojson/src/components/styles';
@@ -4347,7 +4400,7 @@ declare module '@mappedin/dynamic-focus/geojson/src' {
4347
4400
  export { ANIMATION_TWEENS } from '@mappedin/dynamic-focus/geojson/src/camera';
4348
4401
  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, };
4349
4402
  export function createRenderer(container: HTMLElement, options?: RendererCoreOptions & {
4350
- [key: string]: any;
4403
+ [key: string]: any;
4351
4404
  }): Promise<RendererCore>;
4352
4405
  }
4353
4406
 
@@ -4590,19 +4643,19 @@ declare module '@mappedin/dynamic-focus/mappedin-js/src/events' {
4590
4643
  /**
4591
4644
  * Emitted when the Blue Dot's position is updated.
4592
4645
  */
4593
- 'blue-dot-position-update': TBlueDotEvents['position-update'];
4646
+ 'blue-dot-position-update': TBlueDotEvents['blue-dot-position-update'];
4594
4647
  /**
4595
4648
  * Emitted when the Blue Dot's state changes.
4596
4649
  */
4597
- 'blue-dot-state-change': TBlueDotEvents['state-change'];
4650
+ 'blue-dot-state-change': TBlueDotEvents['blue-dot-state-change'];
4598
4651
  /**
4599
4652
  * Emitted when the Blue Dot encounters an error.
4600
4653
  */
4601
- 'blue-dot-error': TBlueDotEvents['error'];
4654
+ 'blue-dot-position-error': TBlueDotEvents['blue-dot-position-error'];
4602
4655
  /**
4603
4656
  * Emitted when the Blue Dot's follow mode changes.
4604
4657
  */
4605
- 'blue-dot-follow-change': TBlueDotEvents['follow-change'];
4658
+ 'blue-dot-follow-change': TBlueDotEvents['blue-dot-follow-change'];
4606
4659
  /**
4607
4660
  * Emitted when a navigation connection is clicked.
4608
4661
  */
@@ -4660,6 +4713,12 @@ declare module '@mappedin/dynamic-focus/mappedin-js/src/events' {
4660
4713
  blueDot: boolean;
4661
4714
  };
4662
4715
  };
4716
+ export type TMapDataEvents = {
4717
+ 'language-change': {
4718
+ code: string;
4719
+ name: string;
4720
+ };
4721
+ };
4663
4722
  }
4664
4723
 
4665
4724
  declare module '@mappedin/dynamic-focus/mappedin-js/src/map-data-objects/base-metadata-object' {
@@ -4787,12 +4846,20 @@ declare module '@mappedin/dynamic-focus/mappedin-js/src/analytics/customer' {
4787
4846
  /**
4788
4847
  * @internal
4789
4848
  */
4790
- sendMapViewLoadedEvent({ firstRenderDuration, dimension, }: {
4849
+ sendMapViewLoadedEvent({ firstRenderDuration, dimension, collisionWorkerDisabled, outdoorsWorkerDisabled, }: {
4791
4850
  firstRenderDuration: number;
4792
4851
  dimension: {
4793
4852
  height: number;
4794
4853
  width: number;
4795
4854
  };
4855
+ /**
4856
+ * True when setWorkerURL is set, but the worker file cannot be found, so we disable the collision worker and use sync collision detection instead
4857
+ */
4858
+ collisionWorkerDisabled: boolean;
4859
+ /**
4860
+ * True when setWorkerURL is set, but the worker file cannot be found, so we disable the outdoor context
4861
+ */
4862
+ outdoorsWorkerDisabled: boolean;
4796
4863
  }): void | Promise<Response> | Promise<void>;
4797
4864
  /**
4798
4865
  * @internal
@@ -4942,7 +5009,6 @@ declare module '@mappedin/dynamic-focus/mappedin-js/src/api-geojson/directions/i
4942
5009
 
4943
5010
  declare module '@mappedin/dynamic-focus/mappedin-js/src/map-data' {
4944
5011
  import { Analytics } from '@mappedin/dynamic-focus/mappedin-js/src/analytics';
4945
- import { PubSub } from '@packages/internal/common/pubsub';
4946
5012
  import type { TSearchOptions } from '@packages/internal/mvf-utils';
4947
5013
  import type { Connection, Door, Floor, MapDataInternal, Space, MapObject, PointOfInterest, Annotation, Coordinate, FloorStack, Node, Facade, Area, EnterpriseCategory, EnterpriseLocation, EnterpriseVenue, LocationProfile, LocationCategory } from '@mappedin/dynamic-focus/mappedin-js/src/map-data-objects';
4948
5014
  import { Search } from '@mappedin/dynamic-focus/mappedin-js/src/search';
@@ -4950,6 +5016,7 @@ declare module '@mappedin/dynamic-focus/mappedin-js/src/map-data' {
4950
5016
  import type { Directions } from '@mappedin/dynamic-focus/mappedin-js/src/api-geojson/directions';
4951
5017
  import type { Query } from '@mappedin/dynamic-focus/mappedin-js/src/query';
4952
5018
  import type { IGeoJSONData } from '@mappedin/dynamic-focus/mappedin-js/src/map-data-objects/types';
5019
+ import type { TMapDataEvents } from '@mappedin/dynamic-focus/mappedin-js/src/events';
4953
5020
  /**
4954
5021
  * A WeakMap to associate {@link MapData} instances with their internal representation.
4955
5022
  * We need a way to get the internal data object from the API
@@ -5010,12 +5077,7 @@ declare module '@mappedin/dynamic-focus/mappedin-js/src/map-data' {
5010
5077
  * Represents the data for a map, providing access to map elements
5011
5078
  * like spaces, floors, and points of interest.
5012
5079
  */
5013
- class MapData extends PubSub<{
5014
- 'language-change': {
5015
- code: string;
5016
- name: string;
5017
- };
5018
- }> {
5080
+ class MapData {
5019
5081
  #private;
5020
5082
  Analytics: Analytics;
5021
5083
  /**
@@ -5080,6 +5142,49 @@ declare module '@mappedin/dynamic-focus/mappedin-js/src/map-data' {
5080
5142
  constructor(internal: MapDataInternal, { search }?: {
5081
5143
  search?: TSearchOptions;
5082
5144
  });
5145
+ /**
5146
+ * Subscribe to MapData events.
5147
+ *
5148
+ * Listen for events emitted by the MapData instance such as language changes.
5149
+ *
5150
+ * @param eventName The name of the event to listen for.
5151
+ * @param fn The callback function to execute when the event is emitted.
5152
+ *
5153
+ * @example Listen for language changes
5154
+ * ```ts
5155
+ * mapData.on('language-change', ({ code, name }) => {
5156
+ * console.log(`Language changed to ${name} (${code})`);
5157
+ *
5158
+ * // Update UI to reflect new language
5159
+ * updateInterfaceLanguage(code);
5160
+ * });
5161
+ * ```
5162
+ */
5163
+ on: <EventName extends keyof TMapDataEvents>(eventName: EventName, fn: (payload: TMapDataEvents[EventName] extends {
5164
+ data: null;
5165
+ } ? TMapDataEvents[EventName]["data"] : TMapDataEvents[EventName]) => void) => void;
5166
+ /**
5167
+ * Unsubscribe from MapData events.
5168
+ *
5169
+ * @param eventName The name of the event to unsubscribe from.
5170
+ * @param fn The callback function that was previously registered with `on()`.
5171
+ *
5172
+ * @example Remove language change listener
5173
+ * ```ts
5174
+ * const handleLanguageChange = ({ code, name }) => {
5175
+ * console.log(`Language changed to ${name}`);
5176
+ * };
5177
+ *
5178
+ * // Add listener
5179
+ * mapData.on('language-change', handleLanguageChange);
5180
+ *
5181
+ * // Later, remove the listener
5182
+ * mapData.off('language-change', handleLanguageChange);
5183
+ * ```
5184
+ */
5185
+ off: <EventName extends keyof TMapDataEvents>(eventName: EventName, fn: (payload: TMapDataEvents[EventName] extends {
5186
+ data: null;
5187
+ } ? TMapDataEvents[EventName]["data"] : TMapDataEvents[EventName]) => void) => void;
5083
5188
  /**
5084
5189
  * Get the current environment configuration.
5085
5190
  *
@@ -5641,7 +5746,6 @@ declare module '@mappedin/dynamic-focus/packages/mvf-utils' {
5641
5746
  declare module '@mappedin/dynamic-focus/mappedin-js/src/map-view' {
5642
5747
  import { type RendererCore, type WatermarkUpdateOptions } from '@mappedin/dynamic-focus/geojson/src';
5643
5748
  import type { EasingCurve } from '@packages/internal/common';
5644
- import { PubSub } from '@packages/internal/common';
5645
5749
  import { type TEvents, type TShow3DMapOptions } from '@mappedin/dynamic-focus/mappedin-js/src';
5646
5750
  import type { Navigation } from '@mappedin/dynamic-focus/mappedin-js/src/navigation';
5647
5751
  import type { Camera, Labels, Markers, Models, Paths, Exporter, Directions, Style, Outdoor, Images } from '@mappedin/dynamic-focus/mappedin-js/src/api-geojson';
@@ -5741,7 +5845,7 @@ declare module '@mappedin/dynamic-focus/mappedin-js/src/map-view' {
5741
5845
  *
5742
5846
  * For help getting started, refer to the [Getting Started Guide](https://developer.mappedin.com/web-sdk/getting-started).
5743
5847
  */
5744
- export class MapView extends PubSub<TEvents> {
5848
+ export class MapView {
5745
5849
  #private;
5746
5850
  /**
5747
5851
  * Controls for the map's camera.
@@ -6722,7 +6826,6 @@ declare module '@mappedin/dynamic-focus/mappedin-js/src/maplibre-overlay' {
6722
6826
  import { type TShow3DMapOptions } from '@mappedin/dynamic-focus/mappedin-js/src';
6723
6827
  import type { Position } from '@mappedin/core-sdk';
6724
6828
  import type { IControl } from '@packages/internal/outdoor-context-v4';
6725
- import { PubSub } from '@packages/internal/common';
6726
6829
  export type TMappedinMapLibreOverlayEvents = {
6727
6830
  /**
6728
6831
  * Event emitted when the MappedinMap is loaded
@@ -6791,7 +6894,7 @@ declare module '@mappedin/dynamic-focus/mappedin-js/src/maplibre-overlay' {
6791
6894
  *
6792
6895
  * Refer to the [Mappedin MapLibre Overlay](https://developer.mappedin.com/web-sdk/mappedin-maplibre-overlay) for more information and interactive examples.
6793
6896
  */
6794
- export class MappedinMapLibreOverlay extends PubSub<TMappedinMapLibreOverlayEvents> implements IControl {
6897
+ export class MappedinMapLibreOverlay implements IControl {
6795
6898
  #private;
6796
6899
  static instance: MappedinMapLibreOverlay;
6797
6900
  /** @internal */
@@ -6937,7 +7040,7 @@ declare module '@mappedin/dynamic-focus/mappedin-js/src/constants' {
6937
7040
 
6938
7041
  declare module '@mappedin/dynamic-focus/mappedin-js/src/api-geojson/blue-dot/blue-dot' {
6939
7042
  import type { RendererCore } from '@mappedin/core-sdk';
6940
- import { PubSub, EasingCurve } from '@packages/internal/common';
7043
+ import { EasingCurve } from '@packages/internal/common';
6941
7044
  import { Coordinate, type Floor } from '@mappedin/dynamic-focus/mappedin-js/src/map-data-objects';
6942
7045
  import type { TBlueDotOptions, TBlueDotPositionUpdate } from '@mappedin/dynamic-focus/mappedin-js/src/types';
6943
7046
  import type { GeoJsonApi } from '@mappedin/dynamic-focus/mappedin-js/src/api-geojson/api';
@@ -6945,7 +7048,7 @@ declare module '@mappedin/dynamic-focus/mappedin-js/src/api-geojson/blue-dot/blu
6945
7048
  /**
6946
7049
  * Emitted when the Blue Dot's position is updated.
6947
7050
  */
6948
- 'position-update': {
7051
+ 'blue-dot-position-update': {
6949
7052
  floor: Floor | undefined;
6950
7053
  heading: GeolocationPosition['coords']['heading'] | undefined;
6951
7054
  accuracy: GeolocationPosition['coords']['accuracy'] | undefined;
@@ -6954,7 +7057,7 @@ declare module '@mappedin/dynamic-focus/mappedin-js/src/api-geojson/blue-dot/blu
6954
7057
  /**
6955
7058
  * Emitted when the Blue Dot's state changes.
6956
7059
  */
6957
- 'state-change': {
7060
+ 'blue-dot-state-change': {
6958
7061
  /**
6959
7062
  * The new state of the Blue Dot.
6960
7063
  */
@@ -6965,13 +7068,13 @@ declare module '@mappedin/dynamic-focus/mappedin-js/src/api-geojson/blue-dot/blu
6965
7068
  action: TBlueDotAction;
6966
7069
  };
6967
7070
  /**
6968
- * Emitted when the Blue Dot encounters an error.
7071
+ * Emitted when the Blue Dot encounters a GeolocationPositionError.
6969
7072
  */
6970
- error: GeolocationPositionError;
7073
+ 'blue-dot-position-error': GeolocationPositionError;
6971
7074
  /**
6972
7075
  * Emitted when the Blue Dot's following state changes.
6973
7076
  */
6974
- 'follow-change': {
7077
+ 'blue-dot-follow-change': {
6975
7078
  /**
6976
7079
  * Whether the Blue Dot is following the user.
6977
7080
  */
@@ -7015,7 +7118,7 @@ declare module '@mappedin/dynamic-focus/mappedin-js/src/api-geojson/blue-dot/blu
7015
7118
  * mapView.BlueDot.follow('position-and-heading', { zoomLevel: 21, pitch: 45 });
7016
7119
  *
7017
7120
  * // Listen for state changes
7018
- * mapView.BlueDot.on('state-change', ({ state, action }) => {
7121
+ * mapView.on('blue-dot-state-change', ({ state, action }) => {
7019
7122
  * console.log('BlueDot state:', state, 'Action:', action);
7020
7123
  * });
7021
7124
  * ```
@@ -7030,7 +7133,7 @@ declare module '@mappedin/dynamic-focus/mappedin-js/src/api-geojson/blue-dot/blu
7030
7133
  *
7031
7134
  * This class is accessed using {@link MapView.BlueDot}.
7032
7135
  */
7033
- export class BlueDot extends PubSub<TBlueDotEvents> {
7136
+ export class BlueDot {
7034
7137
  #private;
7035
7138
  /**
7036
7139
  * The current state of the BlueDot. Can be 'hidden', 'active', 'inactive', or 'disabled'.
@@ -7068,7 +7171,7 @@ declare module '@mappedin/dynamic-focus/mappedin-js/src/api-geojson/blue-dot/blu
7068
7171
  /**
7069
7172
  * @internal
7070
7173
  */
7071
- constructor(core: RendererCore, geoJSONApi: GeoJsonApi);
7174
+ constructor(core: RendererCore, api: GeoJsonApi);
7072
7175
  /**
7073
7176
  * Enable the Blue Dot. It will be hidden until a position is received either from the browser or by calling {@link BlueDot.update}.
7074
7177
  * @param options - The options to setup the Blue Dot (see {@link TBlueDotOptions}).
@@ -7380,7 +7483,6 @@ declare module '@mappedin/dynamic-focus/mappedin-js/src/debug' {
7380
7483
 
7381
7484
  declare module '@mappedin/dynamic-focus/mappedin-js/src/navigation' {
7382
7485
  import { type TDirectionInstruction } from '@mappedin/dynamic-focus/mappedin-js/src';
7383
- import { PubSub } from '@mappedin/dynamic-focus/packages/common/pubsub';
7384
7486
  import type { Directions, GeoJsonApi } from '@mappedin/dynamic-focus/mappedin-js/src/api-geojson';
7385
7487
  import type { GeojsonApiMapObject } from '@mappedin/dynamic-focus/mappedin-js/src/api-geojson/map-object';
7386
7488
  import type { Floor, FloorStack } from '@mappedin/dynamic-focus/mappedin-js/src/map-data-objects';
@@ -7566,6 +7668,21 @@ declare module '@mappedin/dynamic-focus/mappedin-js/src/navigation' {
7566
7668
  * Emitted when the navigation state changes.
7567
7669
  */
7568
7670
  'navigation-state-change': NavigationState;
7671
+ /**
7672
+ * Emitted when a connection point is clicked.
7673
+ */
7674
+ 'navigation-connection-click': {
7675
+ fromFloor?: Floor;
7676
+ toFloor: Floor;
7677
+ instruction: TDirectionInstruction;
7678
+ };
7679
+ /**
7680
+ * Emitted when the active path changes.
7681
+ */
7682
+ 'navigation-active-path-change': {
7683
+ directions: Directions;
7684
+ path: Path;
7685
+ };
7569
7686
  };
7570
7687
  /**
7571
7688
  * 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.
@@ -7578,7 +7695,7 @@ declare module '@mappedin/dynamic-focus/mappedin-js/src/navigation' {
7578
7695
  *
7579
7696
  * Refer to the [Drawing Navigation](https://developer.mappedin.com/web-sdk/wayfinding#drawing-navigation) in the Wayfinding Guide for more information and interactive examples.
7580
7697
  */
7581
- export class Navigation extends PubSub<TNavigationEvents> {
7698
+ export class Navigation {
7582
7699
  #private;
7583
7700
  /**
7584
7701
  * @internal
@@ -7659,6 +7776,7 @@ declare module '@mappedin/dynamic-focus/mappedin-js/src/navigation' {
7659
7776
 
7660
7777
  declare module '@mappedin/dynamic-focus/mappedin-js/src/api-geojson/api' {
7661
7778
  import type { RendererCore, WatermarkUpdateOptions } from '@mappedin/core-sdk';
7779
+ import { PubSub } from '@packages/internal/common';
7662
7780
  import { type TShow3DMapOptions } from '@mappedin/dynamic-focus/mappedin-js/src';
7663
7781
  import { WALLS, DOORS } from '@mappedin/dynamic-focus/mappedin-js/src/types';
7664
7782
  import type MapData from '@mappedin/dynamic-focus/mappedin-js/src/map-data';
@@ -7667,7 +7785,7 @@ declare module '@mappedin/dynamic-focus/mappedin-js/src/api-geojson/api' {
7667
7785
  import type { MapView } from '@mappedin/dynamic-focus/mappedin-js/src/map-view';
7668
7786
  import { Label, Marker, Shape } from '@mappedin/dynamic-focus/mappedin-js/src/map-view-objects';
7669
7787
  import { Text3D as Text3DView, Model, Path, type Image } from '@mappedin/dynamic-focus/mappedin-js/src/map-view-objects';
7670
- import { Navigation } from '@mappedin/dynamic-focus/mappedin-js/src/navigation';
7788
+ import { Navigation, type TNavigationEvents } from '@mappedin/dynamic-focus/mappedin-js/src/navigation';
7671
7789
  import type { TGetState, TUpdateState } from '@mappedin/dynamic-focus/mappedin-js/src/types';
7672
7790
  import { Camera } from '@mappedin/dynamic-focus/mappedin-js/src/api-geojson/camera';
7673
7791
  import { Exporter } from '@mappedin/dynamic-focus/mappedin-js/src/api-geojson/exporter';
@@ -7677,9 +7795,9 @@ declare module '@mappedin/dynamic-focus/mappedin-js/src/api-geojson/api' {
7677
7795
  import { Images } from '@mappedin/dynamic-focus/mappedin-js/src/api-geojson/images';
7678
7796
  import { Models } from '@mappedin/dynamic-focus/mappedin-js/src/api-geojson/models';
7679
7797
  import { Paths } from '@mappedin/dynamic-focus/mappedin-js/src/api-geojson/paths';
7680
- import type { BlueDotState } from '@mappedin/dynamic-focus/mappedin-js/src/api-geojson/blue-dot';
7798
+ import type { BlueDotState, TBlueDotEvents } from '@mappedin/dynamic-focus/mappedin-js/src/api-geojson/blue-dot';
7681
7799
  import { BlueDot } from '@mappedin/dynamic-focus/mappedin-js/src/api-geojson/blue-dot';
7682
- import type { TFloorChangeReason } from '@mappedin/dynamic-focus/mappedin-js/src/events';
7800
+ import type { TEvents, TFloorChangeReason } from '@mappedin/dynamic-focus/mappedin-js/src/events';
7683
7801
  import { Shapes } from '@mappedin/dynamic-focus/mappedin-js/src/api-geojson/shapes';
7684
7802
  import { Style } from '@mappedin/dynamic-focus/mappedin-js/src/api-geojson/style';
7685
7803
  import Outdoor from '@mappedin/dynamic-focus/mappedin-js/src/api-geojson/outdoor';
@@ -7687,7 +7805,7 @@ declare module '@mappedin/dynamic-focus/mappedin-js/src/api-geojson/api' {
7687
7805
  import { Text3D } from '@mappedin/dynamic-focus/mappedin-js/src/api-geojson/text3d';
7688
7806
  import { PathSegment } from '@mappedin/dynamic-focus/mappedin-js/src/map-view-objects/path';
7689
7807
  import { Tween } from '@tweenjs/tween.js';
7690
- export class GeoJsonApi {
7808
+ export class GeoJsonApi extends PubSub<TBlueDotEvents & TNavigationEvents> {
7691
7809
  #private;
7692
7810
  core: RendererCore;
7693
7811
  mapObjects: GeojsonApiMapObject[];
@@ -7703,6 +7821,13 @@ declare module '@mappedin/dynamic-focus/mappedin-js/src/api-geojson/api' {
7703
7821
  layers: string[]
7704
7822
  ][];
7705
7823
  mapView: MapView;
7824
+ /**
7825
+ * External event bus for MapView - bridges internal API events to public API.
7826
+ *
7827
+ * Internal systems publish events here which are then exposed to developers via
7828
+ * MapView.on() and MapView.off().
7829
+ */
7830
+ externalPubSub: PubSub<TEvents>;
7706
7831
  get manualFloorVisibility(): boolean;
7707
7832
  set manualFloorVisibility(value: boolean);
7708
7833
  Camera: Camera;
@@ -7719,7 +7844,7 @@ declare module '@mappedin/dynamic-focus/mappedin-js/src/api-geojson/api' {
7719
7844
  Style: Style;
7720
7845
  Images: Images;
7721
7846
  get StackedMaps(): import("..").StackedMaps;
7722
- constructor(rendererCore: RendererCore, mapView: MapView);
7847
+ constructor(rendererCore: RendererCore, mapView: MapView, externalPubSub: PubSub<TEvents>);
7723
7848
  preloadFloors(floors: Floor[]): void;
7724
7849
  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;
7725
7850
  update: () => void;
@@ -7939,9 +8064,14 @@ declare module '@mappedin/dynamic-focus/mappedin-js/src/query/external' {
7939
8064
  */
7940
8065
  | 'same-elevation';
7941
8066
  /**
7942
- * The radius to search for features within
8067
+ * The radius to search for features within, only used if useLineOfSight is true
7943
8068
  */
7944
8069
  radius?: number;
8070
+ /**
8071
+ * Whether to use line of sight checks to filter results. This ensures that results aren't obstructed by walls, etc.
8072
+ * @default true
8073
+ */
8074
+ lineOfSight?: boolean;
7945
8075
  /**
7946
8076
  * The types to query for
7947
8077
  */
@@ -11705,107 +11835,6 @@ declare module '@mappedin/dynamic-focus/packages/geojson-navigator' {
11705
11835
  export * from '@mappedin/dynamic-focus/packages/geojson-navigator/src';
11706
11836
  }
11707
11837
 
11708
- declare module '@mappedin/dynamic-focus/geojson/src/utils' {
11709
- import type { Object3D, PerspectiveCamera, Camera as THREECamera } from 'three';
11710
- import { BoxGeometry, Mesh, MeshBasicMaterial, Box2 } from 'three';
11711
- import { MercatorCoordinate } from '@mappedin/dynamic-focus/packages/outdoor-context-v4';
11712
- import type { CustomLayerInterface } from '@mappedin/dynamic-focus/packages/outdoor-context-v4';
11713
- import { GroupContainerObject3D } from '@mappedin/dynamic-focus/geojson/src/entities/group-container';
11714
- import type { Geometry2D } from '@mappedin/dynamic-focus/geojson/src/entities/geometry2d';
11715
- import type { Geometry3DTypes } from '@mappedin/dynamic-focus/geojson/src/entities/geometry3d';
11716
- import type { Position, RendererState } from '@mappedin/dynamic-focus/geojson/src/renderer';
11717
- import type { Camera } from '@mappedin/dynamic-focus/geojson/src/camera';
11718
- import { GeometryGroupObject3D } from '@mappedin/dynamic-focus/geojson/src/entities/geometry-group';
11719
- export { isFiniteBox } from '@packages/internal/common';
11720
- import type { Position as GeoJSONPosition } from 'geojson';
11721
- export function cartesianToGeographic(centerLat: number, centerLon: number, x: number, y: number): {
11722
- lat: number;
11723
- lon: number;
11724
- };
11725
- export function geographicToCartesian(centerLat: number, centerLon: number, targetLat: number, targetLon: number): {
11726
- x: number;
11727
- y: number;
11728
- };
11729
- export const populateGeometry3DIdsInScene: (tree: GroupContainerObject3D["children"][0] | Object3D, entities: RendererState["geometry3DIdsInScene"], loadGeometryGroupIds: RendererState["geometryGroupIdsToLoad"]) => Set<string | number>;
11730
- export const populateGeometry2DIdsInScene: (tree: any, entities: Set<Geometry2D["id"]>) => Set<string | number>;
11731
- export function convertMapLibreStylePaintProps(paint: any): {
11732
- color: any;
11733
- height: any;
11734
- altitude: any;
11735
- opacity: any;
11736
- outline: any;
11737
- };
11738
- export function convertMapLibreLineStylePaintProps(paint: any): {
11739
- color: any;
11740
- join: any;
11741
- opacity: any;
11742
- width: any;
11743
- cap: any;
11744
- };
11745
- export function mergeObjects<T extends Record<string, any>>(obj1: T, obj2: T): T;
11746
- export function createCustomLayer(modelAsMercatorCoordinate: MercatorCoordinate, viewCamera: THREECamera, camera: Camera, onRender: () => void): CustomLayerInterface;
11747
- export function getRequestHeaders(authURL: string): Promise<{
11748
- 'x-mappedin-tiles-key': string;
11749
- }>;
11750
- export function cyrb53(str: string, seed?: number): number;
11751
- /**
11752
- /* getProjectionScaleFactor()
11753
- /* finds the scale ratio between screen coordinates and 3D coordinates (in X-Z plane)
11754
- /*
11755
- * R
11756
- * /|
11757
- * C : Camera / |
11758
- * PQ : Projection Plane / |
11759
- * OR : Origin / |
11760
- * F : FOV / |
11761
- * Q / |
11762
- * /| |
11763
- * / | |
11764
- * / | |
11765
- * / | |
11766
- * / | |
11767
- * / F/2 | |
11768
- * C ------------P------------ O
11769
- *
11770
- *
11771
- * ProjectionScaleFactor = ( OR / PQ )
11772
- * PQ = canvasHeight / 2
11773
- * CQ = zoom
11774
- *
11775
- * OR / C0 = tan(F/2)
11776
- * so OR = CO * tan(F/2)
11777
- */
11778
- export function getProjectionScaleFactor(FOV: number, canvasHeight: number, zoom: number): number;
11779
- export function getBoundingBoxCenter(bbox: Position[]): [number, number];
11780
- export { getCornersOfBoundingBox } from '@mappedin/dynamic-focus/geojson/src/utils/bounding-box';
11781
- export { getGeometryByGeometryId } from '@mappedin/dynamic-focus/geojson/src/utils/ecs';
11782
- export { getPixelRatio } from '@mappedin/dynamic-focus/geojson/src/utils/get-pixel-ratio';
11783
- export { debounce } from '@mappedin/dynamic-focus/geojson/src/utils/async';
11784
- export { shouldDisableOffscreenCanvas } from '@mappedin/dynamic-focus/geojson/src/utils/browser';
11785
- export { noop, pick, isEmpty, type KeysOfUnion } from '@mappedin/dynamic-focus/geojson/src/utils/fp';
11786
- export { transformRequest } from '@mappedin/dynamic-focus/geojson/src/utils/tranform-request';
11787
- export { normalizeAngle } from '@mappedin/dynamic-focus/geojson/src/utils/math';
11788
- export function shouldExpandZoomLevel(minZoomFromCurrentPanBounds: number, cameraZoomLevel: number): boolean;
11789
- export function getGroupContainerOpacity(entity: Geometry3DTypes | GeometryGroupObject3D): number;
11790
- /**
11791
- * Checks if two coordinate arrays are equal within a small tolerance to handle floating point precision issues.
11792
- *
11793
- * @param coord1 - First coordinate [longitude, latitude] or [longitude, latitude, altitude]
11794
- * @param coord2 - Second coordinate [longitude, latitude] or [longitude, latitude, altitude]
11795
- * @param tolerance - Tolerance for floating point comparison (default: 1e-10)
11796
- * @returns True if coordinates are equal within tolerance
11797
- */
11798
- export function coordinatesEqual(coord1: GeoJSONPosition, coord2: GeoJSONPosition, tolerance?: number): boolean;
11799
- export const MAPLIBRE_FRUSTRUM_CULL_HACK_NAME = "maplibre-frustum-culling-hack";
11800
- /**
11801
- * TODO: Find the actual root of the problem and fix it.
11802
- * This is a hack to get around some geometry disappearing when we're added as a layer in maplibre.
11803
- */
11804
- export function maplibreFrustrumCullHack(): Mesh<BoxGeometry, MeshBasicMaterial, import("three").Object3DEventMap>;
11805
- export function projectToBox2D(object: Object3D, camera: PerspectiveCamera, result?: Box2): Box2;
11806
- export function drawProjectedBox(box: Box2, color: string, container: HTMLElement): HTMLDivElement;
11807
- }
11808
-
11809
11838
  declare module '@mappedin/dynamic-focus/geojson/src/utils/constants' {
11810
11839
  import type { InsetPadding } from '@mappedin/dynamic-focus/geojson/src/types';
11811
11840
  export const DEFAULT_INSET_PADDING: InsetPadding;
@@ -11821,6 +11850,8 @@ declare module '@mappedin/dynamic-focus/geojson/src/utils/constants' {
11821
11850
  * Duration of zoom in/out animation when double tapping with one finger or single tapping with two fingers.
11822
11851
  */
11823
11852
  export const TAP_ZOOM_DURATION = 250;
11853
+ export const COLLISION_WORKER_PATH = "collision-worker.csp.js";
11854
+ export const MAPLIBRE_WORKER_PATH = "maplibre-worker.csp.js";
11824
11855
  }
11825
11856
 
11826
11857
  declare module '@mappedin/dynamic-focus/geojson/src/utils/debug' {
@@ -12656,8 +12687,9 @@ declare module '@mappedin/dynamic-focus/geojson/src/systems/text3d/system' {
12656
12687
  }> {
12657
12688
  textSet: Set<string>;
12658
12689
  batchedTextMap: Map<GroupContainerObject3D, Promise<BatchedText>>;
12690
+ useWorker: boolean;
12659
12691
  remove(id: string): void;
12660
- constructor(rendererState: RendererState, convertTo3DMapPosition: RendererCore['convertTo3DMapPosition']);
12692
+ constructor(rendererState: RendererState, convertTo3DMapPosition: RendererCore['convertTo3DMapPosition'], useWorker?: boolean);
12661
12693
  update(cameraRotationRadians: number): Promise<void[]>;
12662
12694
  showTextAreaMesh(): void;
12663
12695
  hideTextAreaMesh(): void;
@@ -12678,135 +12710,22 @@ declare module '@mappedin/dynamic-focus/geojson/src/systems/text3d/system' {
12678
12710
  export const DEFAULT_VERTICAL_OFFSET = 0.5;
12679
12711
  }
12680
12712
 
12681
- declare module '@mappedin/dynamic-focus/geojson/src/systems/collisions/system' {
12682
- import { QuadTree } from '@packages/internal/quad-tree';
12683
- import '../../styles/collisions.scss';
12684
- import type { MarkerComponent } from '@mappedin/dynamic-focus/geojson/src/components/marker';
12685
- import type LabelComponent from '@mappedin/dynamic-focus/geojson/src/components/label';
12686
- import { PubSub } from '@mappedin/dynamic-focus/packages/common/pubsub';
12687
- import type { RendererState } from '@mappedin/dynamic-focus/geojson/src/renderer';
12688
- import type { TSerializedCollider, TSerializedColliderResponse } from '@mappedin/dynamic-focus/geojson/src/systems/collisions/collider-processor';
12689
- import type { WatermarkPosition } from '@mappedin/dynamic-focus/geojson/src/systems/watermark/system';
12690
- export type TMessageEvent = MessageEvent<{
12691
- msgId: string;
12692
- colliders: TSerializedColliderResponse[];
12693
- debug: {
12694
- x: number;
12695
- y: number;
12696
- w: number;
12697
- h: number;
12698
- }[];
12699
- }>;
12700
- export type TMessage = {
12701
- msgId: string;
12702
- totalWidth: number;
12703
- totalHeight: number;
12704
- watermarkWidth: number;
12705
- watermarkHeight: number;
12706
- watermarkPosition: WatermarkPosition;
12707
- colliders: TSerializedCollider[];
12708
- devicePixelRatio: number;
12709
- };
12710
- type TCollisionSystemEvent = {
12711
- 'visibility-changed': undefined;
12712
- };
12713
- export type PackedBBox = [x: number, y: number, w: number, h: number, index: number];
12714
- export type PackedBBoxes = PackedBBox[];
12715
- export type PackedCollider = [
12716
- bboxes: PackedBBoxes,
12717
- enabled: 0 | 1,
12718
- alwaysVisible: 0 | 1,
12719
- x: number,
12720
- y: number,
12721
- shouldCollideWithScreenEdges?: 0 | 1,
12722
- onlyExposeStrategyIndex?: number
12723
- ];
12724
- export type PackedMessage = [
12725
- colliders: PackedCollider[],
12726
- devicePixelRatio: number,
12727
- totalHeight: number,
12728
- totalWidth: number,
12729
- watermarkWidth: number,
12730
- watermarkHeight: number,
12731
- watermarkPosition: WatermarkPosition
12732
- ];
12733
- export class CollisionSystem extends PubSub<TCollisionSystemEvent, keyof TCollisionSystemEvent> {
12734
- collidersDirty: boolean;
12735
- packedMessage: PackedMessage;
12736
- visibleCollidersQTree: QuadTree<{
12737
- entityId: string | number;
12738
- }>;
12739
- interactiveCollidersQTree: QuadTree<{
12740
- entityId: string | number;
12741
- }>;
12742
- coreState: RendererState;
12743
- constructor(debugCanvas: HTMLCanvasElement, coreState: RendererState, worker?: Worker);
12744
- postMessage: () => void;
12745
- showCollisionBoxes: () => void;
12746
- hideCollisionBoxes: () => void;
12747
- currentMsgId: string;
12748
- working: boolean;
12749
- componentArray: (MarkerComponent | LabelComponent)[];
12750
- update: (watermarkWidth: number, watermarkHeight: number, watermarkPosition?: WatermarkPosition, isPanning?: boolean) => void;
12751
- resize(watermarkWidth: number, watermarkHeight: number, watermarkPosition: WatermarkPosition): void;
12752
- /**
12753
- * Resolve collisions
12754
- */
12755
- resolve: (e: MessageEvent<{
12756
- msgId: string;
12757
- colliders: TSerializedColliderResponse[];
12758
- }>) => void;
12759
- drawDebug: () => void;
12760
- destroy: () => void;
12761
- }
12762
- /**
12763
- * Sets the URL for the collision system worker script.
12764
- *
12765
- * This function allows specifying a custom URL for the collision system's web worker,
12766
- * which is particularly useful in environments with strict Content Security Policy (CSP)
12767
- * that don't allow blob: URLs or inline scripts.
12768
- *
12769
- * When provided, the collision system will load its worker from the specified URL
12770
- * instead of creating an inline worker from a blob. This enables compatibility with
12771
- * environments that have restrictive CSP settings.
12772
- *
12773
- * @param url - The absolute URL pointing to the collision worker script.
12774
- * This should be a URL where the compiled version of the worker.ts file is hosted.
12775
- *
12776
- * @example
12777
- * ```typescript
12778
- * // Set a custom URL for the collision worker
12779
- * import { setWorkerUrl } from '@mappedin/core-sdk';
12780
- *
12781
- * // Must be called before initializing any maps
12782
- * setWorkerUrl('https://cdn.example.com/workers/collision-worker.js');
12783
- * ```
12784
- *
12785
- * @remarks
12786
- * - This function must be called before any map instances are created
12787
- * - The worker file must be built and hosted separately as part of your deployment process
12788
- * - Ideal for applications that need to comply with strict CSP requirements
12789
- */
12790
- export function setWorkerUrl(url: string): void;
12791
- export {};
12792
- }
12793
-
12794
- declare module '@mappedin/dynamic-focus/geojson/src/systems/exporter' {
12795
- export { ExporterSystem, type GLTFExportOptions } from '@mappedin/dynamic-focus/geojson/src/systems/exporter/exporter';
12796
- }
12797
-
12798
- declare module '@mappedin/dynamic-focus/geojson/src/systems/html-controls/system' {
12799
- import type { Map } from '@mappedin/dynamic-focus/packages/outdoor-context-v4';
12800
- import '../../styles/html-controls.scss';
12801
- /**
12802
- * All possible control anchor positions.
12803
- */
12804
- export const ATTRIBUTION_POSITIONS: readonly ["top-left", "top-right", "bottom-left", "bottom-right"];
12805
- export type AttributionPosition = (typeof ATTRIBUTION_POSITIONS)[number];
12806
- export type AttributionControlOptions = {
12807
- custom?: string[];
12808
- position?: AttributionPosition;
12809
- feedback?: boolean;
12713
+ declare module '@mappedin/dynamic-focus/geojson/src/systems/exporter' {
12714
+ export { ExporterSystem, type GLTFExportOptions } from '@mappedin/dynamic-focus/geojson/src/systems/exporter/exporter';
12715
+ }
12716
+
12717
+ declare module '@mappedin/dynamic-focus/geojson/src/systems/html-controls/system' {
12718
+ import type { Map } from '@mappedin/dynamic-focus/packages/outdoor-context-v4';
12719
+ import '../../styles/html-controls.scss';
12720
+ /**
12721
+ * All possible control anchor positions.
12722
+ */
12723
+ export const ATTRIBUTION_POSITIONS: readonly ["top-left", "top-right", "bottom-left", "bottom-right"];
12724
+ export type AttributionPosition = (typeof ATTRIBUTION_POSITIONS)[number];
12725
+ export type AttributionControlOptions = {
12726
+ custom?: string[];
12727
+ position?: AttributionPosition;
12728
+ feedback?: boolean;
12810
12729
  };
12811
12730
  export class HTMLControlsSystem {
12812
12731
  controlContainerEl: HTMLDivElement;
@@ -13929,12 +13848,12 @@ declare module '@mappedin/dynamic-focus/mappedin-js/src/api-geojson/map-object'
13929
13848
  import { PubSub } from '@packages/internal/common';
13930
13849
  import type { Position, AddLabelOptions, RendererCore, PathState, MarkerState, LineStyle, PaintStyle, EntityId, Text3DState } from '@mappedin/core-sdk';
13931
13850
  import { FloorObject } from '@mappedin/dynamic-focus/mappedin-js/src/api-geojson/floor-object';
13932
- import type { Directions, Floor, TAddMarkerOptions, TAddPathOptions, TShow3DMapOptions } from '@mappedin/dynamic-focus/mappedin-js/src';
13933
- import type { GLTFExportOptions, TAnimationOptions, TAddModelOptions, TAddImageOptions, TDirectionInstruction, TAddText3DOptions, IAnchorable, TAddLabelOptions } from '@mappedin/dynamic-focus/mappedin-js/src/types';
13851
+ import type { TAddMarkerOptions, TAddPathOptions, TShow3DMapOptions } from '@mappedin/dynamic-focus/mappedin-js/src';
13852
+ import type { GLTFExportOptions, TAnimationOptions, TAddModelOptions, TAddImageOptions, TAddText3DOptions, IAnchorable, TAddLabelOptions } from '@mappedin/dynamic-focus/mappedin-js/src/types';
13934
13853
  import { type AggregatedStyleMap } from '@mappedin/dynamic-focus/mappedin-js/src/api-geojson/utils';
13935
13854
  import { StackedMaps } from '@mappedin/dynamic-focus/mappedin-js/src/api-geojson/stacked-maps/stacked-maps';
13936
13855
  import type { TFloorChangeReason } from '@mappedin/dynamic-focus/mappedin-js/src/events';
13937
- import type { Path, Shape } from '@mappedin/dynamic-focus/mappedin-js/src/map-view-objects';
13856
+ import type { Shape } from '@mappedin/dynamic-focus/mappedin-js/src/map-view-objects';
13938
13857
  import type { MapDataInternal } from '@mappedin/dynamic-focus/mappedin-js/src/map-data-objects';
13939
13858
  import { Space, Coordinate } from '@mappedin/dynamic-focus/mappedin-js/src/map-data-objects';
13940
13859
  import { type GeoJsonApi } from '@mappedin/dynamic-focus/mappedin-js/src/api-geojson/api';
@@ -13950,15 +13869,6 @@ declare module '@mappedin/dynamic-focus/mappedin-js/src/api-geojson/map-object'
13950
13869
  floorId: string;
13951
13870
  previousFloorId: string;
13952
13871
  };
13953
- 'navigation-connection-click': {
13954
- fromFloor?: Floor;
13955
- toFloor: Floor;
13956
- instruction: TDirectionInstruction;
13957
- };
13958
- 'navigation-active-path-change': {
13959
- directions: Directions;
13960
- path: Path;
13961
- };
13962
13872
  }> {
13963
13873
  #private;
13964
13874
  floorStacksById: Map<string, FloorStackObject>;
@@ -14055,68 +13965,6 @@ declare module '@mappedin/dynamic-focus/mappedin-js/src/api-geojson/map-object'
14055
13965
  };
14056
13966
  }
14057
13967
 
14058
- declare module '@mappedin/dynamic-focus/packages/common/pubsub' {
14059
- /**
14060
- * Generic PubSub class implementing the Publish-Subscribe pattern for event handling.
14061
- *
14062
- * @template EVENT_PAYLOAD - The type of the event payload.
14063
- * @template EVENT - The type of the event.
14064
- */
14065
- export class PubSub<EVENT_PAYLOAD, EVENT extends keyof EVENT_PAYLOAD = keyof EVENT_PAYLOAD> {
14066
- /**
14067
- * @private
14068
- * @internal
14069
- */
14070
- _subscribers: any;
14071
- /**
14072
- * @private
14073
- * @internal
14074
- */
14075
- publish<EVENT_NAME extends EVENT>(eventName: EVENT_NAME, data?: EVENT_PAYLOAD[EVENT_NAME]): void;
14076
- /**
14077
- * Subscribe a function to an event.
14078
- *
14079
- * @param eventName An event name which, when fired, will call the provided
14080
- * function.
14081
- * @param fn A callback that gets called when the corresponding event is fired. The
14082
- * callback will get passed an argument with a type that's one of event payloads.
14083
- * @example
14084
- * // Subscribe to the 'click' event
14085
- * const handler = (event) => {
14086
- * const { coordinate } = event;
14087
- * const { latitude, longitude } = coordinate;
14088
- * console.log(`Map was clicked at ${latitude}, ${longitude}`);
14089
- * };
14090
- * map.on('click', handler);
14091
- */
14092
- on<EVENT_NAME extends EVENT>(eventName: EVENT_NAME, fn: (payload: EVENT_PAYLOAD[EVENT_NAME] extends {
14093
- data: null;
14094
- } ? EVENT_PAYLOAD[EVENT_NAME]['data'] : EVENT_PAYLOAD[EVENT_NAME]) => void): void;
14095
- /**
14096
- * Unsubscribe a function previously subscribed with {@link on}
14097
- *
14098
- * @param eventName An event name to which the provided function was previously
14099
- * subscribed.
14100
- * @param fn A function that was previously passed to {@link on}. The function must
14101
- * have the same reference as the function that was subscribed.
14102
- * @example
14103
- * // Unsubscribe from the 'click' event
14104
- * const handler = (event) => {
14105
- * console.log('Map was clicked', event);
14106
- * };
14107
- * map.off('click', handler);
14108
- */
14109
- off<EVENT_NAME extends EVENT>(eventName: EVENT_NAME, fn: (payload: EVENT_PAYLOAD[EVENT_NAME] extends {
14110
- data: null;
14111
- } ? EVENT_PAYLOAD[EVENT_NAME]['data'] : EVENT_PAYLOAD[EVENT_NAME]) => void): void;
14112
- /**
14113
- * @private
14114
- * @internal
14115
- */
14116
- destroy(): void;
14117
- }
14118
- }
14119
-
14120
13968
  declare module '@mappedin/dynamic-focus/mappedin-js/src/api-geojson/camera' {
14121
13969
  import type { IFocusable, TCameraAnimationOptions, TCameraTarget, TFocusOnOptions, TCameraInteractionsSetOptions } from '@mappedin/dynamic-focus/mappedin-js/src/types';
14122
13970
  import type { InsetPadding } from '@mappedin/dynamic-focus/geojson/src';
@@ -15148,7 +14996,6 @@ declare module '@mappedin/dynamic-focus/mappedin-js/src/api-geojson/outdoor' {
15148
14996
 
15149
14997
  declare module '@mappedin/dynamic-focus/mappedin-js/src/navigation/index' {
15150
14998
  import { type TDirectionInstruction } from '@mappedin/dynamic-focus/mappedin-js/src';
15151
- import { PubSub } from '@mappedin/dynamic-focus/packages/common/pubsub';
15152
14999
  import type { Directions, GeoJsonApi } from '@mappedin/dynamic-focus/mappedin-js/src/api-geojson';
15153
15000
  import type { GeojsonApiMapObject } from '@mappedin/dynamic-focus/mappedin-js/src/api-geojson/map-object';
15154
15001
  import type { Floor, FloorStack } from '@mappedin/dynamic-focus/mappedin-js/src/map-data-objects';
@@ -15334,6 +15181,21 @@ declare module '@mappedin/dynamic-focus/mappedin-js/src/navigation/index' {
15334
15181
  * Emitted when the navigation state changes.
15335
15182
  */
15336
15183
  'navigation-state-change': NavigationState;
15184
+ /**
15185
+ * Emitted when a connection point is clicked.
15186
+ */
15187
+ 'navigation-connection-click': {
15188
+ fromFloor?: Floor;
15189
+ toFloor: Floor;
15190
+ instruction: TDirectionInstruction;
15191
+ };
15192
+ /**
15193
+ * Emitted when the active path changes.
15194
+ */
15195
+ 'navigation-active-path-change': {
15196
+ directions: Directions;
15197
+ path: Path;
15198
+ };
15337
15199
  };
15338
15200
  /**
15339
15201
  * 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.
@@ -15346,7 +15208,7 @@ declare module '@mappedin/dynamic-focus/mappedin-js/src/navigation/index' {
15346
15208
  *
15347
15209
  * Refer to the [Drawing Navigation](https://developer.mappedin.com/web-sdk/wayfinding#drawing-navigation) in the Wayfinding Guide for more information and interactive examples.
15348
15210
  */
15349
- export class Navigation extends PubSub<TNavigationEvents> {
15211
+ export class Navigation {
15350
15212
  #private;
15351
15213
  /**
15352
15214
  * @internal
@@ -15783,6 +15645,90 @@ declare module '@mappedin/dynamic-focus/mappedin-js/src/search/external' {
15783
15645
  };
15784
15646
  }
15785
15647
 
15648
+ declare module '@mappedin/dynamic-focus/geojson/src/systems/collisions/system' {
15649
+ import { QuadTree } from '@packages/internal/quad-tree';
15650
+ import '../../styles/collisions.scss';
15651
+ import type { MarkerComponent } from '@mappedin/dynamic-focus/geojson/src/components/marker';
15652
+ import type LabelComponent from '@mappedin/dynamic-focus/geojson/src/components/label';
15653
+ import { PubSub } from '@mappedin/dynamic-focus/packages/common/pubsub';
15654
+ import type { RendererState } from '@mappedin/dynamic-focus/geojson/src/renderer';
15655
+ import type { TSerializedCollider, TSerializedColliderResponse } from '@mappedin/dynamic-focus/geojson/src/systems/collisions/collider-processor';
15656
+ import type { WatermarkPosition } from '@mappedin/dynamic-focus/geojson/src/systems/watermark/system';
15657
+ export type TMessageEvent = MessageEvent<{
15658
+ msgId: string;
15659
+ colliders: TSerializedColliderResponse[];
15660
+ debug: {
15661
+ x: number;
15662
+ y: number;
15663
+ w: number;
15664
+ h: number;
15665
+ }[];
15666
+ }>;
15667
+ export type TMessage = {
15668
+ msgId: string;
15669
+ totalWidth: number;
15670
+ totalHeight: number;
15671
+ watermarkWidth: number;
15672
+ watermarkHeight: number;
15673
+ watermarkPosition: WatermarkPosition;
15674
+ colliders: TSerializedCollider[];
15675
+ devicePixelRatio: number;
15676
+ };
15677
+ type TCollisionSystemEvent = {
15678
+ 'visibility-changed': undefined;
15679
+ };
15680
+ export type PackedBBox = [x: number, y: number, w: number, h: number, index: number];
15681
+ export type PackedBBoxes = PackedBBox[];
15682
+ export type PackedCollider = [
15683
+ bboxes: PackedBBoxes,
15684
+ enabled: 0 | 1,
15685
+ alwaysVisible: 0 | 1,
15686
+ x: number,
15687
+ y: number,
15688
+ shouldCollideWithScreenEdges?: 0 | 1,
15689
+ onlyExposeStrategyIndex?: number
15690
+ ];
15691
+ export type PackedMessage = [
15692
+ colliders: PackedCollider[],
15693
+ devicePixelRatio: number,
15694
+ totalHeight: number,
15695
+ totalWidth: number,
15696
+ watermarkWidth: number,
15697
+ watermarkHeight: number,
15698
+ watermarkPosition: WatermarkPosition
15699
+ ];
15700
+ export class CollisionSystem extends PubSub<TCollisionSystemEvent, keyof TCollisionSystemEvent> {
15701
+ collidersDirty: boolean;
15702
+ packedMessage: PackedMessage;
15703
+ visibleCollidersQTree: QuadTree<{
15704
+ entityId: string | number;
15705
+ }>;
15706
+ interactiveCollidersQTree: QuadTree<{
15707
+ entityId: string | number;
15708
+ }>;
15709
+ coreState: RendererState;
15710
+ constructor(debugCanvas: HTMLCanvasElement, coreState: RendererState, useWorker?: boolean);
15711
+ postMessage: () => void;
15712
+ showCollisionBoxes: () => void;
15713
+ hideCollisionBoxes: () => void;
15714
+ currentMsgId: string;
15715
+ working: boolean;
15716
+ componentArray: (MarkerComponent | LabelComponent)[];
15717
+ update: (watermarkWidth: number, watermarkHeight: number, watermarkPosition?: WatermarkPosition, isPanning?: boolean) => void;
15718
+ resize(watermarkWidth: number, watermarkHeight: number, watermarkPosition: WatermarkPosition): void;
15719
+ /**
15720
+ * Resolve collisions
15721
+ */
15722
+ resolve: (e: MessageEvent<{
15723
+ msgId: string;
15724
+ colliders: TSerializedColliderResponse[];
15725
+ }>) => void;
15726
+ drawDebug: () => void;
15727
+ destroy: () => void;
15728
+ }
15729
+ export {};
15730
+ }
15731
+
15786
15732
  declare module '@mappedin/dynamic-focus/geojson/src/entities/geometry3d' {
15787
15733
  import { Object3D } from 'three';
15788
15734
  import type { Mesh, Object3DEventMap, ShaderMaterial, Texture, TubeGeometry, Color, Vector2, Raycaster } from 'three';
@@ -16265,6 +16211,8 @@ declare module '@mappedin/dynamic-focus/geojson/src/types/options' {
16265
16211
  occlusionEnabled?: boolean;
16266
16212
  /** Callback to intercept and modify requests for images. */
16267
16213
  transformImageRequest?: TransformImageRequest;
16214
+ useWorkers?: boolean;
16215
+ useCollisionWorker?: boolean;
16268
16216
  }>;
16269
16217
  }
16270
16218
 
@@ -16299,6 +16247,68 @@ declare module '@mappedin/dynamic-focus/geojson/src/systems/mesh-creation-and-op
16299
16247
  }
16300
16248
  }
16301
16249
 
16250
+ declare module '@mappedin/dynamic-focus/packages/common/pubsub' {
16251
+ /**
16252
+ * Generic PubSub class implementing the Publish-Subscribe pattern for event handling.
16253
+ *
16254
+ * @template EVENT_PAYLOAD - The type of the event payload.
16255
+ * @template EVENT - The type of the event.
16256
+ */
16257
+ export class PubSub<EVENT_PAYLOAD, EVENT extends keyof EVENT_PAYLOAD = keyof EVENT_PAYLOAD> {
16258
+ /**
16259
+ * @private
16260
+ * @internal
16261
+ */
16262
+ _subscribers: any;
16263
+ /**
16264
+ * @private
16265
+ * @internal
16266
+ */
16267
+ publish<EVENT_NAME extends EVENT>(eventName: EVENT_NAME, data?: EVENT_PAYLOAD[EVENT_NAME]): void;
16268
+ /**
16269
+ * Subscribe a function to an event.
16270
+ *
16271
+ * @param eventName An event name which, when fired, will call the provided
16272
+ * function.
16273
+ * @param fn A callback that gets called when the corresponding event is fired. The
16274
+ * callback will get passed an argument with a type that's one of event payloads.
16275
+ * @example
16276
+ * // Subscribe to the 'click' event
16277
+ * const handler = (event) => {
16278
+ * const { coordinate } = event;
16279
+ * const { latitude, longitude } = coordinate;
16280
+ * console.log(`Map was clicked at ${latitude}, ${longitude}`);
16281
+ * };
16282
+ * map.on('click', handler);
16283
+ */
16284
+ on<EVENT_NAME extends EVENT>(eventName: EVENT_NAME, fn: (payload: EVENT_PAYLOAD[EVENT_NAME] extends {
16285
+ data: null;
16286
+ } ? EVENT_PAYLOAD[EVENT_NAME]['data'] : EVENT_PAYLOAD[EVENT_NAME]) => void): void;
16287
+ /**
16288
+ * Unsubscribe a function previously subscribed with {@link on}
16289
+ *
16290
+ * @param eventName An event name to which the provided function was previously
16291
+ * subscribed.
16292
+ * @param fn A function that was previously passed to {@link on}. The function must
16293
+ * have the same reference as the function that was subscribed.
16294
+ * @example
16295
+ * // Unsubscribe from the 'click' event
16296
+ * const handler = (event) => {
16297
+ * console.log('Map was clicked', event);
16298
+ * };
16299
+ * map.off('click', handler);
16300
+ */
16301
+ off<EVENT_NAME extends EVENT>(eventName: EVENT_NAME, fn: (payload: EVENT_PAYLOAD[EVENT_NAME] extends {
16302
+ data: null;
16303
+ } ? EVENT_PAYLOAD[EVENT_NAME]['data'] : EVENT_PAYLOAD[EVENT_NAME]) => void): void;
16304
+ /**
16305
+ * @private
16306
+ * @internal
16307
+ */
16308
+ destroy(): void;
16309
+ }
16310
+ }
16311
+
16302
16312
  declare module '@mappedin/dynamic-focus/geojson/src/services/renderer' {
16303
16313
  import type { Scene, Camera } from 'three';
16304
16314
  import { Color, WebGLRenderer } from 'three';
@@ -16936,6 +16946,107 @@ declare module '@mappedin/dynamic-focus/geojson/src/systems/geometry-disposal/sy
16936
16946
  }
16937
16947
  }
16938
16948
 
16949
+ declare module '@mappedin/dynamic-focus/geojson/src/utils' {
16950
+ import type { Object3D, PerspectiveCamera, Camera as THREECamera } from 'three';
16951
+ import { BoxGeometry, Mesh, MeshBasicMaterial, Box2 } from 'three';
16952
+ import { MercatorCoordinate } from '@mappedin/dynamic-focus/packages/outdoor-context-v4';
16953
+ import type { CustomLayerInterface } from '@mappedin/dynamic-focus/packages/outdoor-context-v4';
16954
+ import { GroupContainerObject3D } from '@mappedin/dynamic-focus/geojson/src/entities/group-container';
16955
+ import type { Geometry2D } from '@mappedin/dynamic-focus/geojson/src/entities/geometry2d';
16956
+ import type { Geometry3DTypes } from '@mappedin/dynamic-focus/geojson/src/entities/geometry3d';
16957
+ import type { Position, RendererState } from '@mappedin/dynamic-focus/geojson/src/renderer';
16958
+ import type { Camera } from '@mappedin/dynamic-focus/geojson/src/camera';
16959
+ import { GeometryGroupObject3D } from '@mappedin/dynamic-focus/geojson/src/entities/geometry-group';
16960
+ export { isFiniteBox } from '@packages/internal/common';
16961
+ import type { Position as GeoJSONPosition } from 'geojson';
16962
+ export function cartesianToGeographic(centerLat: number, centerLon: number, x: number, y: number): {
16963
+ lat: number;
16964
+ lon: number;
16965
+ };
16966
+ export function geographicToCartesian(centerLat: number, centerLon: number, targetLat: number, targetLon: number): {
16967
+ x: number;
16968
+ y: number;
16969
+ };
16970
+ export const populateGeometry3DIdsInScene: (tree: GroupContainerObject3D["children"][0] | Object3D, entities: RendererState["geometry3DIdsInScene"], loadGeometryGroupIds: RendererState["geometryGroupIdsToLoad"]) => Set<string | number>;
16971
+ export const populateGeometry2DIdsInScene: (tree: any, entities: Set<Geometry2D["id"]>) => Set<string | number>;
16972
+ export function convertMapLibreStylePaintProps(paint: any): {
16973
+ color: any;
16974
+ height: any;
16975
+ altitude: any;
16976
+ opacity: any;
16977
+ outline: any;
16978
+ };
16979
+ export function convertMapLibreLineStylePaintProps(paint: any): {
16980
+ color: any;
16981
+ join: any;
16982
+ opacity: any;
16983
+ width: any;
16984
+ cap: any;
16985
+ };
16986
+ export function mergeObjects<T extends Record<string, any>>(obj1: T, obj2: T): T;
16987
+ export function createCustomLayer(modelAsMercatorCoordinate: MercatorCoordinate, viewCamera: THREECamera, camera: Camera, onRender: () => void): CustomLayerInterface;
16988
+ export function getRequestHeaders(authURL: string): Promise<{
16989
+ 'x-mappedin-tiles-key': string;
16990
+ }>;
16991
+ export function cyrb53(str: string, seed?: number): number;
16992
+ /**
16993
+ /* getProjectionScaleFactor()
16994
+ /* finds the scale ratio between screen coordinates and 3D coordinates (in X-Z plane)
16995
+ /*
16996
+ * R
16997
+ * /|
16998
+ * C : Camera / |
16999
+ * PQ : Projection Plane / |
17000
+ * OR : Origin / |
17001
+ * F : FOV / |
17002
+ * Q / |
17003
+ * /| |
17004
+ * / | |
17005
+ * / | |
17006
+ * / | |
17007
+ * / | |
17008
+ * / F/2 | |
17009
+ * C ------------P------------ O
17010
+ *
17011
+ *
17012
+ * ProjectionScaleFactor = ( OR / PQ )
17013
+ * PQ = canvasHeight / 2
17014
+ * CQ = zoom
17015
+ *
17016
+ * OR / C0 = tan(F/2)
17017
+ * so OR = CO * tan(F/2)
17018
+ */
17019
+ export function getProjectionScaleFactor(FOV: number, canvasHeight: number, zoom: number): number;
17020
+ export function getBoundingBoxCenter(bbox: Position[]): [number, number];
17021
+ export { getCornersOfBoundingBox } from '@mappedin/dynamic-focus/geojson/src/utils/bounding-box';
17022
+ export { getGeometryByGeometryId } from '@mappedin/dynamic-focus/geojson/src/utils/ecs';
17023
+ export { getPixelRatio } from '@mappedin/dynamic-focus/geojson/src/utils/get-pixel-ratio';
17024
+ export { debounce } from '@mappedin/dynamic-focus/geojson/src/utils/async';
17025
+ export { shouldDisableOffscreenCanvas } from '@mappedin/dynamic-focus/geojson/src/utils/browser';
17026
+ export { noop, pick, isEmpty, type KeysOfUnion } from '@mappedin/dynamic-focus/geojson/src/utils/fp';
17027
+ export { transformRequest } from '@mappedin/dynamic-focus/geojson/src/utils/tranform-request';
17028
+ export { normalizeAngle } from '@mappedin/dynamic-focus/geojson/src/utils/math';
17029
+ export function shouldExpandZoomLevel(minZoomFromCurrentPanBounds: number, cameraZoomLevel: number): boolean;
17030
+ export function getGroupContainerOpacity(entity: Geometry3DTypes | GeometryGroupObject3D): number;
17031
+ /**
17032
+ * Checks if two coordinate arrays are equal within a small tolerance to handle floating point precision issues.
17033
+ *
17034
+ * @param coord1 - First coordinate [longitude, latitude] or [longitude, latitude, altitude]
17035
+ * @param coord2 - Second coordinate [longitude, latitude] or [longitude, latitude, altitude]
17036
+ * @param tolerance - Tolerance for floating point comparison (default: 1e-10)
17037
+ * @returns True if coordinates are equal within tolerance
17038
+ */
17039
+ export function coordinatesEqual(coord1: GeoJSONPosition, coord2: GeoJSONPosition, tolerance?: number): boolean;
17040
+ export const MAPLIBRE_FRUSTRUM_CULL_HACK_NAME = "maplibre-frustum-culling-hack";
17041
+ /**
17042
+ * TODO: Find the actual root of the problem and fix it.
17043
+ * This is a hack to get around some geometry disappearing when we're added as a layer in maplibre.
17044
+ */
17045
+ export function maplibreFrustrumCullHack(): Mesh<BoxGeometry, MeshBasicMaterial, import("three").Object3DEventMap>;
17046
+ export function projectToBox2D(object: Object3D, camera: PerspectiveCamera, result?: Box2): Box2;
17047
+ export function drawProjectedBox(box: Box2, color: string, container: HTMLElement): HTMLDivElement;
17048
+ }
17049
+
16939
17050
  declare module '@mappedin/dynamic-focus/geojson/src/components/styles/style' {
16940
17051
  import type { LineStyle } from '@mappedin/dynamic-focus/geojson/src/renderer';
16941
17052
  export const DEFAULT_COLOR = "#ffffff";
@@ -17002,104 +17113,6 @@ declare module '@mappedin/dynamic-focus/packages/geojson-navigator/src' {
17002
17113
  export type { CoordinateFeature, CoordinateProperties } from '@mappedin/dynamic-focus/packages/geojson-navigator/src/types/coordinate';
17003
17114
  }
17004
17115
 
17005
- declare module '@mappedin/dynamic-focus/geojson/src/utils/bounding-box' {
17006
- import { type Box3, Vector3 } from 'three';
17007
- export function getCornersOfBoundingBox(boundingBox: Box3): Vector3[];
17008
- }
17009
-
17010
- declare module '@mappedin/dynamic-focus/geojson/src/utils/ecs' {
17011
- import type { Geometry2D, Geometry3DTypes } from '@mappedin/dynamic-focus/geojson/src/entities';
17012
- import type { GroupContainerObject3D } from '@mappedin/dynamic-focus/geojson/src/entities/group-container';
17013
- import type { GeometryGroupObject3D } from '@mappedin/dynamic-focus/geojson/src/entities/geometry-group';
17014
- import type { EntityId, EntityState, RendererState } from '@mappedin/dynamic-focus/geojson/src/renderer';
17015
- import { Box3, Vector3 } from 'three';
17016
- import type RendererCore from '@mappedin/dynamic-focus/geojson/src/renderer';
17017
- export function getGeometryByGeometryId(state: RendererState, geometryOrGeometryId?: string | number | Record<string, any>): Geometry3DTypes | GeometryGroupObject3D | GroupContainerObject3D | Geometry2D | undefined;
17018
- export function getVerticesOfEntity(core: RendererCore, geometryOrGeometryId?: string | number | EntityId<EntityState>, vertices?: Vector3[], bounds?: Box3, zOffset?: number): Vector3[];
17019
- }
17020
-
17021
- declare module '@mappedin/dynamic-focus/geojson/src/utils/get-pixel-ratio' {
17022
- export function getPixelRatio(): number;
17023
- }
17024
-
17025
- declare module '@mappedin/dynamic-focus/geojson/src/utils/async' {
17026
- export function throttle<T>(func: () => void, wait: number, options?: any): () => void;
17027
- export function debounce<T extends (...args: any[]) => void>(func: T, wait: number, immediate?: boolean): (...args: Parameters<T>) => void;
17028
- }
17029
-
17030
- declare module '@mappedin/dynamic-focus/geojson/src/utils/browser' {
17031
- type DeviceType = {
17032
- isIpad: boolean;
17033
- isMobile: boolean;
17034
- isSafari12: boolean;
17035
- isFirefox: boolean;
17036
- isWindows: boolean;
17037
- };
17038
- /**
17039
- * Get device OS info
17040
- * export for testing purpose
17041
- * @returns DeviceType
17042
- */
17043
- export const _deviceTypeControl: {
17044
- getDeviceType(): DeviceType;
17045
- _reset(): void;
17046
- };
17047
- export const getDeviceType: () => DeviceType;
17048
- /**
17049
- * Creates a closure encapsulating the logic of getting device GPU info.
17050
- * inspired by https://github.com/pmndrs/detect-gpu
17051
- * export for testing
17052
- */
17053
- export const _gpuInfoControl: {
17054
- getInfo: () => string | undefined;
17055
- shouldDisableOffscreenCanvas: () => boolean;
17056
- _setCanvas(c: HTMLCanvasElement): void;
17057
- };
17058
- export const getGPUInfo: () => string | undefined;
17059
- /**
17060
- * Check if device is certain intel integrated GPU.
17061
- * This is for implementing workaround - https://issues.chromium.org/issues/40251953
17062
- * The reason we want to disable OffscreenCanvas at all is due to `willReadFrequently` flag only works in FF.
17063
- * In order to ensure the integrated intel GPU render text correctly
17064
- */
17065
- export const shouldDisableOffscreenCanvas: () => boolean;
17066
- export {};
17067
- }
17068
-
17069
- declare module '@mappedin/dynamic-focus/geojson/src/utils/fp' {
17070
- export function noop(): void;
17071
- export type KeysOfUnion<T> = T extends T ? keyof T : never;
17072
- /**
17073
- * Given an object and a number of properties as strings, return version
17074
- * of that object with only those properties.
17075
- *
17076
- * @param src - the object
17077
- * @param properties - an array of property names chosen
17078
- * to appear on the resulting object.
17079
- * @returns object with limited properties.
17080
- * @example
17081
- * ```ts
17082
- * let foo = { name: 'Charlie', age: 10 };
17083
- * let justName = pick(foo, ['name']); // justName = { name: 'Charlie' }
17084
- * ```
17085
- */
17086
- export function pick<T extends object>(src: T, properties: KeysOfUnion<T>[]): Partial<T>;
17087
- export function isEmpty(obj: Record<string, any>): boolean;
17088
- }
17089
-
17090
- declare module '@mappedin/dynamic-focus/geojson/src/utils/tranform-request' {
17091
- export const transformRequest: (headers: {
17092
- "x-mappedin-tiles-key": string;
17093
- }) => (url: string) => {
17094
- url: string;
17095
- headers: {};
17096
- };
17097
- }
17098
-
17099
- declare module '@mappedin/dynamic-focus/geojson/src/utils/math' {
17100
- export function normalizeAngle(angle: number): number;
17101
- }
17102
-
17103
17116
  declare module '@mappedin/dynamic-focus/geojson/src/entities' {
17104
17117
  export { updateInteractivity } from '@mappedin/dynamic-focus/geojson/src/entities/utils';
17105
17118
  export { Geometry2D, Geometry2DComponents } from '@mappedin/dynamic-focus/geojson/src/entities/geometry2d';
@@ -17138,35 +17151,6 @@ declare module '@mappedin/dynamic-focus/geojson/src/systems/camera/helpers' {
17138
17151
  export * from '@mappedin/dynamic-focus/geojson/src/systems/camera/helpers/utils';
17139
17152
  }
17140
17153
 
17141
- declare module '@mappedin/dynamic-focus/geojson/src/systems/collisions/collider-processor' {
17142
- import { Rectangle } from '@packages/internal/quad-tree';
17143
- export type TSerializedCollider = {
17144
- rank: number;
17145
- enabledAndVisible: boolean;
17146
- x: number;
17147
- y: number;
17148
- bboxes: {
17149
- index: number;
17150
- boundingBox: [number, number, number, number];
17151
- boundingRect?: Rectangle;
17152
- }[];
17153
- shouldCollideWithScreenEdges?: boolean;
17154
- lockedToStrategyIndex?: number;
17155
- visible?: boolean;
17156
- };
17157
- export type TSerializedColliderResponse = [number, 1 | 0, Rectangle?];
17158
- export function processColliders(colliders: TSerializedCollider[], totalWidth: any, totalHeight: any, watermarkWidth: any, watermarkHeight: any, watermarkPosition: any, msgId?: string): {
17159
- msgId: string;
17160
- colliders: TSerializedColliderResponse[];
17161
- debug: {
17162
- x: number;
17163
- y: number;
17164
- w: number;
17165
- h: number;
17166
- }[];
17167
- };
17168
- }
17169
-
17170
17154
  declare module '@mappedin/dynamic-focus/geojson/src/systems/exporter/exporter' {
17171
17155
  import type { RendererState } from '@mappedin/dynamic-focus/geojson/src/renderer';
17172
17156
  export type GLTFExportOptions = {
@@ -17642,6 +17626,35 @@ declare module '@mappedin/dynamic-focus/mappedin-js/src/api-geojson/floor-stack-
17642
17626
  }
17643
17627
  }
17644
17628
 
17629
+ declare module '@mappedin/dynamic-focus/geojson/src/systems/collisions/collider-processor' {
17630
+ import { Rectangle } from '@packages/internal/quad-tree';
17631
+ export type TSerializedCollider = {
17632
+ rank: number;
17633
+ enabledAndVisible: boolean;
17634
+ x: number;
17635
+ y: number;
17636
+ bboxes: {
17637
+ index: number;
17638
+ boundingBox: [number, number, number, number];
17639
+ boundingRect?: Rectangle;
17640
+ }[];
17641
+ shouldCollideWithScreenEdges?: boolean;
17642
+ lockedToStrategyIndex?: number;
17643
+ visible?: boolean;
17644
+ };
17645
+ export type TSerializedColliderResponse = [number, 1 | 0, Rectangle?];
17646
+ export function processColliders(colliders: TSerializedCollider[], totalWidth: any, totalHeight: any, watermarkWidth: any, watermarkHeight: any, watermarkPosition: any, msgId?: string): {
17647
+ msgId: string;
17648
+ colliders: TSerializedColliderResponse[];
17649
+ debug: {
17650
+ x: number;
17651
+ y: number;
17652
+ w: number;
17653
+ h: number;
17654
+ }[];
17655
+ };
17656
+ }
17657
+
17645
17658
  declare module '@mappedin/dynamic-focus/geojson/src/components/outline' {
17646
17659
  import type { BufferAttribute, BufferGeometry } from 'three';
17647
17660
  type Outline = {
@@ -25654,6 +25667,104 @@ declare module '@mappedin/dynamic-focus/geojson/src/systems/path/system' {
25654
25667
  }
25655
25668
  }
25656
25669
 
25670
+ declare module '@mappedin/dynamic-focus/geojson/src/utils/bounding-box' {
25671
+ import { type Box3, Vector3 } from 'three';
25672
+ export function getCornersOfBoundingBox(boundingBox: Box3): Vector3[];
25673
+ }
25674
+
25675
+ declare module '@mappedin/dynamic-focus/geojson/src/utils/ecs' {
25676
+ import type { Geometry2D, Geometry3DTypes } from '@mappedin/dynamic-focus/geojson/src/entities';
25677
+ import type { GroupContainerObject3D } from '@mappedin/dynamic-focus/geojson/src/entities/group-container';
25678
+ import type { GeometryGroupObject3D } from '@mappedin/dynamic-focus/geojson/src/entities/geometry-group';
25679
+ import type { EntityId, EntityState, RendererState } from '@mappedin/dynamic-focus/geojson/src/renderer';
25680
+ import { Box3, Vector3 } from 'three';
25681
+ import type RendererCore from '@mappedin/dynamic-focus/geojson/src/renderer';
25682
+ export function getGeometryByGeometryId(state: RendererState, geometryOrGeometryId?: string | number | Record<string, any>): Geometry3DTypes | GeometryGroupObject3D | GroupContainerObject3D | Geometry2D | undefined;
25683
+ export function getVerticesOfEntity(core: RendererCore, geometryOrGeometryId?: string | number | EntityId<EntityState>, vertices?: Vector3[], bounds?: Box3, zOffset?: number): Vector3[];
25684
+ }
25685
+
25686
+ declare module '@mappedin/dynamic-focus/geojson/src/utils/get-pixel-ratio' {
25687
+ export function getPixelRatio(): number;
25688
+ }
25689
+
25690
+ declare module '@mappedin/dynamic-focus/geojson/src/utils/async' {
25691
+ export function throttle<T>(func: () => void, wait: number, options?: any): () => void;
25692
+ export function debounce<T extends (...args: any[]) => void>(func: T, wait: number, immediate?: boolean): (...args: Parameters<T>) => void;
25693
+ }
25694
+
25695
+ declare module '@mappedin/dynamic-focus/geojson/src/utils/browser' {
25696
+ type DeviceType = {
25697
+ isIpad: boolean;
25698
+ isMobile: boolean;
25699
+ isSafari12: boolean;
25700
+ isFirefox: boolean;
25701
+ isWindows: boolean;
25702
+ };
25703
+ /**
25704
+ * Get device OS info
25705
+ * export for testing purpose
25706
+ * @returns DeviceType
25707
+ */
25708
+ export const _deviceTypeControl: {
25709
+ getDeviceType(): DeviceType;
25710
+ _reset(): void;
25711
+ };
25712
+ export const getDeviceType: () => DeviceType;
25713
+ /**
25714
+ * Creates a closure encapsulating the logic of getting device GPU info.
25715
+ * inspired by https://github.com/pmndrs/detect-gpu
25716
+ * export for testing
25717
+ */
25718
+ export const _gpuInfoControl: {
25719
+ getInfo: () => string | undefined;
25720
+ shouldDisableOffscreenCanvas: () => boolean;
25721
+ _setCanvas(c: HTMLCanvasElement): void;
25722
+ };
25723
+ export const getGPUInfo: () => string | undefined;
25724
+ /**
25725
+ * Check if device is certain intel integrated GPU.
25726
+ * This is for implementing workaround - https://issues.chromium.org/issues/40251953
25727
+ * The reason we want to disable OffscreenCanvas at all is due to `willReadFrequently` flag only works in FF.
25728
+ * In order to ensure the integrated intel GPU render text correctly
25729
+ */
25730
+ export const shouldDisableOffscreenCanvas: () => boolean;
25731
+ export {};
25732
+ }
25733
+
25734
+ declare module '@mappedin/dynamic-focus/geojson/src/utils/fp' {
25735
+ export function noop(): void;
25736
+ export type KeysOfUnion<T> = T extends T ? keyof T : never;
25737
+ /**
25738
+ * Given an object and a number of properties as strings, return version
25739
+ * of that object with only those properties.
25740
+ *
25741
+ * @param src - the object
25742
+ * @param properties - an array of property names chosen
25743
+ * to appear on the resulting object.
25744
+ * @returns object with limited properties.
25745
+ * @example
25746
+ * ```ts
25747
+ * let foo = { name: 'Charlie', age: 10 };
25748
+ * let justName = pick(foo, ['name']); // justName = { name: 'Charlie' }
25749
+ * ```
25750
+ */
25751
+ export function pick<T extends object>(src: T, properties: KeysOfUnion<T>[]): Partial<T>;
25752
+ export function isEmpty(obj: Record<string, any>): boolean;
25753
+ }
25754
+
25755
+ declare module '@mappedin/dynamic-focus/geojson/src/utils/tranform-request' {
25756
+ export const transformRequest: (headers: {
25757
+ "x-mappedin-tiles-key": string;
25758
+ }) => (url: string) => {
25759
+ url: string;
25760
+ headers: {};
25761
+ };
25762
+ }
25763
+
25764
+ declare module '@mappedin/dynamic-focus/geojson/src/utils/math' {
25765
+ export function normalizeAngle(angle: number): number;
25766
+ }
25767
+
25657
25768
  declare module '@mappedin/dynamic-focus/packages/geojson-navigator/src/navigator' {
25658
25769
  export * from '@mappedin/dynamic-focus/packages/geojson-navigator/src/navigator/navigator';
25659
25770
  }
@@ -25732,6 +25843,7 @@ declare module '@mappedin/dynamic-focus/packages/geojson-navigator/src/navigator
25732
25843
  multiplicativeDistanceWeightScaling?: boolean;
25733
25844
  overrideEdgeWeights?: Map<Edge, number>;
25734
25845
  }): DirectionsCollection;
25846
+ hasLineOfSight: (origin: [number, number], destination: [number, number], floorId: string, bufferRadius?: number) => boolean;
25735
25847
  /**
25736
25848
  * Calculates the approximate distance between two geographic coordinates on Earth's surface.
25737
25849
  *