@mappedin/mappedin-js 6.0.1-beta.0 → 6.0.1-beta.1

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.
@@ -281,7 +281,7 @@ declare module '@mappedin/mappedin-js' {
281
281
  * Asynchronously retrieves map data ({@link MapData}) based on user-provided options.
282
282
  *
283
283
  * @experimental
284
- * @param userOptions Options provided by the user to retrieve map data.
284
+ * @param userOptions {TGetMapDataOptions} Options provided by the user to retrieve map data.
285
285
  * @returns {Promise<MapData>} Promise resolving to the MapData.
286
286
  * @example
287
287
  * const data = await getMapData({ key: 'api_key', secret: 'api_secret', mapId: 'id' });
@@ -318,11 +318,11 @@ declare module '@mappedin/mappedin-js' {
318
318
  export type { MapView, MapData, MappedinMapLibreOverlay, TEvents, TEventPayload, TClickPayload, THoverPayload, TShow3DMapOptions, TGetMapDataOptions, TGetMapDataWithAccessTokenOptions, TGetMapDataWithCredentialsOptions, TGetMapDataSharedOptions, TAmbientOcclusionOptions, TAntialiasingOptions, TMVF, PaintStyle, LineStyle, Shading, TMVFStyleCollection, TMVFStyle, TMVFLineStringStyle, TMVFPolygonStyle, TMVFPointStyle, };
319
319
  export type * from 'geojson';
320
320
  export type { TUpdateState, TLabelState, TGeometryState, TCameraAnimationOptions, TAnimationOptions, TFocusOnOptions, TEasingFunction, TCameraTarget, TNavigationTarget, TDirectionZone, TCameraFocusOnTarget, TAddMarkerOptions, TAddPathOptions, TLabelAppearance, TAddLabelOptions, TAddModelOptions, TAddModel, TGetDirectionsOptions, TCollisionRankingTier, TMarkerAnchor, TDirectionInstruction, TDirectionInstructionAction, TGetState, TMarkerState, } from '@mappedin/mappedin-js/mappedin-js/src/types';
321
- export type { Label, Marker, Path, CustomGeometry, CameraTransform, Model } from '@mappedin/mappedin-js/mappedin-js/src/map-view-objects';
321
+ export type { Label, Marker, Path, Shape, CameraTransform, Model } from '@mappedin/mappedin-js/mappedin-js/src/map-view-objects';
322
322
  export type { Navigation, TNavigationOptions } from '@mappedin/mappedin-js/mappedin-js/src/navigation';
323
323
  export type { TSpaceType } from '@mappedin/mappedin-js/mappedin-js/src/map-data-objects';
324
324
  export { Coordinate, Annotation, Connection, Door, Floor, MapObject, PointOfInterest, Space, Image, Hyperlink, } from '@mappedin/mappedin-js/mappedin-js/src/map-data-objects';
325
- export type { Camera, Models, Labels, Markers, Paths, Exporter, Directions, Style, Outdoor } from '@mappedin/mappedin-js/mappedin-js/src/api-geojson';
325
+ export type { Camera, Models, Labels, Markers, Paths, Exporter, Directions, Style, Shapes, Outdoor, } from '@mappedin/mappedin-js/mappedin-js/src/api-geojson';
326
326
  export { analytics };
327
327
  }
328
328
 
@@ -700,7 +700,7 @@ declare module '@mappedin/mappedin-js/mappedin-js/src/map-data-objects' {
700
700
  }
701
701
 
702
702
  declare module '@mappedin/mappedin-js/mappedin-js/src/map-view' {
703
- import type { RendererCore } from '@mappedin/core-sdk';
703
+ import type { RendererCore, WatermarkOptions } from '@mappedin/core-sdk';
704
704
  import { PubSub } from '@packages/internal/common';
705
705
  import { type TEvents, type TShow3DMapOptions } from '@mappedin/mappedin-js/mappedin-js/src';
706
706
  import type { Navigation } from '@mappedin/mappedin-js/mappedin-js/src/navigation';
@@ -711,7 +711,7 @@ declare module '@mappedin/mappedin-js/mappedin-js/src/map-view' {
711
711
  import type { TGetDirectionsOptions, TGetState, TNavigationTarget, TUpdateState, TUpdateStates } from '@mappedin/mappedin-js/mappedin-js/src/types';
712
712
  import type { Label, Marker } from '@mappedin/mappedin-js/mappedin-js/src/map-view-objects';
713
713
  import type { TEventPayload } from '@mappedin/mappedin-js/mappedin-js/src/events';
714
- import type { CustomGeometries } from '@mappedin/mappedin-js/mappedin-js/src/api-geojson/custom-geometries';
714
+ import type { Shapes } from '@mappedin/mappedin-js/mappedin-js/src/api-geojson/shapes';
715
715
  export class MapView extends PubSub<TEvents> {
716
716
  #private;
717
717
  /**
@@ -755,7 +755,7 @@ declare module '@mappedin/mappedin-js/mappedin-js/src/map-view' {
755
755
  /**
756
756
  * Controls custom GeoJSON geometry on the map
757
757
  */
758
- CustomGeometries: CustomGeometries;
758
+ Shapes: Shapes;
759
759
  /**
760
760
  * Controls for the outdoor map.
761
761
  */
@@ -823,6 +823,13 @@ declare module '@mappedin/mappedin-js/mappedin-js/src/map-view' {
823
823
  * The current floor ({@link Floor}) of the map.
824
824
  */
825
825
  get currentFloor(): Floor;
826
+ /**
827
+ * Updates the watermark on the map.
828
+ *
829
+ * @param options {WatermarkOptions}
830
+ * @hidden
831
+ */
832
+ updateWatermark(options: Omit<WatermarkOptions, 'onClick'>): void;
826
833
  getState<T extends Space | MapObject | Label | Marker | string>(target: T): TGetState<T> | undefined;
827
834
  setHoverColor(c: string): void;
828
835
  getHoverColor(): string | undefined;
@@ -926,13 +933,14 @@ declare module '@mappedin/mappedin-js/geojson/src' {
926
933
  import type { Position } from '@mappedin/mappedin-js/geojson/src/types/geometry';
927
934
  import type { InsetPadding, RendererCoreOptions, ClickPayload, HoverPayload, CameraPayload, MapEvent, MapEventPayload } from '@mappedin/mappedin-js/geojson/src/types';
928
935
  import type { GeometryState } from '@mappedin/mappedin-js/geojson/src/components/mesh';
929
- import type { CustomGeometryState, CustomGeometryBuilder } from '@mappedin/mappedin-js/geojson/src/components/custom';
936
+ import type { ShapeState, CustomGeometryBuilder } from '@mappedin/mappedin-js/geojson/src/components/custom';
930
937
  import type { ModelState } from '@mappedin/mappedin-js/geojson/src/components/model';
931
938
  import RendererCore, { type MapViewState } from '@mappedin/mappedin-js/geojson/src/renderer';
932
939
  import type { Camera, AnimateToOptions, FocusOnOptions, EasingCurve } from '@mappedin/mappedin-js/geojson/src/camera';
933
940
  import { mountSceneGraphVisualizer } from '@mappedin/mappedin-js/geojson/examples/src/utils/scene-graph-visualizer';
934
941
  import '../../packages/outdoor-context-v4/css/maplibre-gl.css';
935
942
  import type { CollisionRankingTier } from '@mappedin/mappedin-js/geojson/src/utils/collision-ranking-tier';
943
+ export { Navigator } from '@mappedin/mappedin-js/packages/geojson-navigator';
936
944
  export { interpolate, debounce } from '@mappedin/mappedin-js/geojson/src/utils';
937
945
  export { MAPPEDIN_LAYER_ID } from '@mappedin/mappedin-js/geojson/src/utils/constants';
938
946
  /**
@@ -947,7 +955,7 @@ declare module '@mappedin/mappedin-js/geojson/src' {
947
955
  export type { GLTFExportOptions } from '@mappedin/mappedin-js/geojson/src/systems/exporter';
948
956
  export type { AttributionControlOptions, AttributionPosition } from '@mappedin/mappedin-js/geojson/src/systems/html-controls/system';
949
957
  export { ATTRIBUTION_POSITIONS } from '@mappedin/mappedin-js/geojson/src/systems/html-controls/system';
950
- export type { AddPathOptions, AddMarkerOptions, AddLabelOptions, AnimateToOptions, FocusOnOptions, MapViewState, MarkerState, PathState, GroupContainerState, GeometryGroupState, CustomGeometryState, CustomGeometryBuilder, LabelState, GeometryState, ModelState, EasingCurve, Camera, InsetPadding, Position, ClickPayload, HoverPayload, CameraPayload, MapEvent, MapEventPayload, CollisionRankingTier, LabelAppearance, RendererCore, };
958
+ export type { AddPathOptions, AddMarkerOptions, AddLabelOptions, AnimateToOptions, FocusOnOptions, MapViewState, MarkerState, PathState, GroupContainerState, GeometryGroupState, ShapeState, CustomGeometryBuilder, LabelState, GeometryState, ModelState, EasingCurve, Camera, InsetPadding, Position, ClickPayload, HoverPayload, CameraPayload, MapEvent, MapEventPayload, CollisionRankingTier, LabelAppearance, RendererCore, };
951
959
  export function createRenderer(container: HTMLElement, options?: RendererCoreOptions & {
952
960
  [key: string]: any;
953
961
  }): Promise<RendererCore>;
@@ -1297,18 +1305,6 @@ declare module '@mappedin/mappedin-js/mappedin-js/src/types' {
1297
1305
  * @defaultValue 0.4
1298
1306
  */
1299
1307
  farRadius?: number;
1300
- /**
1301
- * Zoom level in meters where the path size is `nearRadius`.
1302
- *
1303
- * @defaultValue 5
1304
- */
1305
- nearZoom?: number;
1306
- /**
1307
- * Zoom level in meters where the path size is `farRadius`.
1308
- *
1309
- * @defaultValue 1000
1310
- */
1311
- farZoom?: number;
1312
1308
  /**
1313
1309
  * Duration of path drawing in milliseconds.
1314
1310
  *
@@ -1676,7 +1672,7 @@ declare module '@mappedin/mappedin-js/mappedin-js/src/map-view-objects' {
1676
1672
  export { Model } from '@mappedin/mappedin-js/mappedin-js/src/map-view-objects/model';
1677
1673
  export { Path } from '@mappedin/mappedin-js/mappedin-js/src/map-view-objects/path';
1678
1674
  export { CameraTransform } from '@mappedin/mappedin-js/mappedin-js/src/map-view-objects/camera-transform';
1679
- export { CustomGeometry } from '@mappedin/mappedin-js/mappedin-js/src/map-view-objects/custom-geometry';
1675
+ export { Shape } from '@mappedin/mappedin-js/mappedin-js/src/map-view-objects/shape';
1680
1676
  }
1681
1677
 
1682
1678
  declare module '@mappedin/mappedin-js/mappedin-js/src/navigation' {
@@ -1776,6 +1772,7 @@ declare module '@mappedin/mappedin-js/mappedin-js/src/api-geojson' {
1776
1772
  export { Camera } from '@mappedin/mappedin-js/mappedin-js/src/api-geojson/camera';
1777
1773
  export { Labels } from '@mappedin/mappedin-js/mappedin-js/src/api-geojson/labels';
1778
1774
  export { Markers } from '@mappedin/mappedin-js/mappedin-js/src/api-geojson/markers';
1775
+ export { Shapes } from '@mappedin/mappedin-js/mappedin-js/src/api-geojson/shapes';
1779
1776
  export { Models } from '@mappedin/mappedin-js/mappedin-js/src/api-geojson/models';
1780
1777
  export { Paths } from '@mappedin/mappedin-js/mappedin-js/src/api-geojson/paths';
1781
1778
  export { Exporter } from '@mappedin/mappedin-js/mappedin-js/src/api-geojson/exporter';
@@ -3029,7 +3026,7 @@ declare module '@mappedin/mappedin-js/mappedin-js/src' {
3029
3026
  * Asynchronously retrieves map data ({@link MapData}) based on user-provided options.
3030
3027
  *
3031
3028
  * @experimental
3032
- * @param userOptions Options provided by the user to retrieve map data.
3029
+ * @param userOptions {TGetMapDataOptions} Options provided by the user to retrieve map data.
3033
3030
  * @returns {Promise<MapData>} Promise resolving to the MapData.
3034
3031
  * @example
3035
3032
  * const data = await getMapData({ key: 'api_key', secret: 'api_secret', mapId: 'id' });
@@ -3066,11 +3063,11 @@ declare module '@mappedin/mappedin-js/mappedin-js/src' {
3066
3063
  export type { MapView, MapData, MappedinMapLibreOverlay, TEvents, TEventPayload, TClickPayload, THoverPayload, TShow3DMapOptions, TGetMapDataOptions, TGetMapDataWithAccessTokenOptions, TGetMapDataWithCredentialsOptions, TGetMapDataSharedOptions, TAmbientOcclusionOptions, TAntialiasingOptions, TMVF, PaintStyle, LineStyle, Shading, TMVFStyleCollection, TMVFStyle, TMVFLineStringStyle, TMVFPolygonStyle, TMVFPointStyle, };
3067
3064
  export type * from 'geojson';
3068
3065
  export type { TUpdateState, TLabelState, TGeometryState, TCameraAnimationOptions, TAnimationOptions, TFocusOnOptions, TEasingFunction, TCameraTarget, TNavigationTarget, TDirectionZone, TCameraFocusOnTarget, TAddMarkerOptions, TAddPathOptions, TLabelAppearance, TAddLabelOptions, TAddModelOptions, TAddModel, TGetDirectionsOptions, TCollisionRankingTier, TMarkerAnchor, TDirectionInstruction, TDirectionInstructionAction, TGetState, TMarkerState, } from '@mappedin/mappedin-js/mappedin-js/src/types';
3069
- export type { Label, Marker, Path, CustomGeometry, CameraTransform, Model } from '@mappedin/mappedin-js/mappedin-js/src/map-view-objects';
3066
+ export type { Label, Marker, Path, Shape, CameraTransform, Model } from '@mappedin/mappedin-js/mappedin-js/src/map-view-objects';
3070
3067
  export type { Navigation, TNavigationOptions } from '@mappedin/mappedin-js/mappedin-js/src/navigation';
3071
3068
  export type { TSpaceType } from '@mappedin/mappedin-js/mappedin-js/src/map-data-objects';
3072
3069
  export { Coordinate, Annotation, Connection, Door, Floor, MapObject, PointOfInterest, Space, Image, Hyperlink, } from '@mappedin/mappedin-js/mappedin-js/src/map-data-objects';
3073
- export type { Camera, Models, Labels, Markers, Paths, Exporter, Directions, Style, Outdoor } from '@mappedin/mappedin-js/mappedin-js/src/api-geojson';
3070
+ export type { Camera, Models, Labels, Markers, Paths, Exporter, Directions, Style, Shapes, Outdoor, } from '@mappedin/mappedin-js/mappedin-js/src/api-geojson';
3074
3071
  export { analytics };
3075
3072
  }
3076
3073
 
@@ -3101,13 +3098,13 @@ declare module '@mappedin/mappedin-js/mappedin-js/src/api-geojson/blue-dot/blue-
3101
3098
  }
3102
3099
  }
3103
3100
 
3104
- declare module '@mappedin/mappedin-js/mappedin-js/src/api-geojson/custom-geometries' {
3101
+ declare module '@mappedin/mappedin-js/mappedin-js/src/api-geojson/shapes' {
3105
3102
  import type { GeojsonApiMapObject } from '@mappedin/mappedin-js/mappedin-js/src/api-geojson/map-object';
3106
- import { CustomGeometry } from '@mappedin/mappedin-js/mappedin-js/src/map-view-objects';
3103
+ import { Shape } from '@mappedin/mappedin-js/mappedin-js/src/map-view-objects';
3107
3104
  import type { FeatureCollection, LineString, MultiPolygon, Polygon } from 'geojson';
3108
3105
  import type { LineStyle, PaintStyle } from '@mappedin/core-sdk';
3109
3106
  import type { Floor } from '@mappedin/mappedin-js/mappedin-js/src/map-data-objects';
3110
- export class CustomGeometries {
3107
+ export class Shapes {
3111
3108
  #private;
3112
3109
  /**
3113
3110
  * @internal
@@ -3122,31 +3119,31 @@ declare module '@mappedin/mappedin-js/mappedin-js/src/api-geojson/custom-geometr
3122
3119
  /**
3123
3120
  * @internal
3124
3121
  */
3125
- getById(id: string): CustomGeometry | undefined;
3122
+ getById(id: string): Shape | undefined;
3126
3123
  /**
3127
- * Adds a custom GeoJSON geometry ({@link CustomGeometry}) to the map.
3124
+ * Adds a custom GeoJSON geometry ({@link Shape}) to the map.
3128
3125
  *
3129
3126
  * @param geometry a valid GeoJSON feature collection
3130
3127
  * @param style
3131
3128
  * @param floor Floor to add the geometry to
3132
- * @returns {CustomGeometry | undefined} The created CustomGeometry, or undefined if creation failed.
3129
+ * @returns {Shape | undefined} The created shapes, or undefined if creation failed.
3133
3130
  * @example
3134
3131
  *
3135
- * map.CustomGeometries.add(polygons, { color: 'red' }, mapView.currentFloor);
3132
+ * map.Shapes.add(polygons, { color: 'red' }, mapView.currentFloor);
3136
3133
  */
3137
- add<T extends FeatureCollection<Polygon | MultiPolygon | LineString, any>>(geometry: T, style: T extends FeatureCollection<LineString, any> ? LineStyle : PaintStyle, floor?: Floor): CustomGeometry;
3134
+ add<T extends FeatureCollection<Polygon | MultiPolygon | LineString, any>>(geometry: T, style: T extends FeatureCollection<LineString, any> ? LineStyle : PaintStyle, floor?: Floor): Shape;
3138
3135
  /**
3139
- * Removes a specific CustomGeometry ({@link CustomGeometry}) from the map.
3140
- * @param customGeometry The CustomGeometry to be removed.
3136
+ * Removes a specific shapes ({@link Shape}) from the map.
3137
+ * @param shapes The shapes to be removed.
3141
3138
  * @example
3142
- * map.CustomGeometries.remove(geo);
3139
+ * map.Shapes.remove(geo);
3143
3140
  */
3144
- remove(customGeometry: CustomGeometry): void;
3141
+ remove(shapes: Shape): void;
3145
3142
  /**
3146
- * Removes all Custom Geometries ({@link CustomGeometry}) from the map.
3143
+ * Removes all Shapes ({@link Shape}) from the map.
3147
3144
  *
3148
3145
  * @example
3149
- * map.CustomGeometries.removeAll();
3146
+ * map.Shapes.removeAll();
3150
3147
  */
3151
3148
  removeAll(): string[];
3152
3149
  }
@@ -3874,11 +3871,11 @@ declare module '@mappedin/mappedin-js/geojson/src/types' {
3874
3871
  import type { ModelState } from '@mappedin/mappedin-js/geojson/src/components/model';
3875
3872
  import type { LabelState } from '@mappedin/mappedin-js/geojson/src/components/label';
3876
3873
  import type { MarkerState } from '@mappedin/mappedin-js/geojson/src/components/marker';
3877
- import type { CustomGeometryState } from '@mappedin/mappedin-js/geojson/src/components/custom';
3874
+ import type { ShapeState } from '@mappedin/mappedin-js/geojson/src/components/custom';
3878
3875
  /**
3879
3876
  * The state of an entity, which can be a geometry, geometry group, group container, path, model, label, or marker.
3880
3877
  */
3881
- export type EntityState = GeometryState | GeometryGroupState | GroupContainerState | PathState | ModelState | LabelState | MarkerState | CustomGeometryState;
3878
+ export type EntityState = GeometryState | GeometryGroupState | GroupContainerState | PathState | ModelState | LabelState | MarkerState | ShapeState;
3882
3879
  /**
3883
3880
  * A wrapper object that contains the ID and type of an entity. This is returned when adding entities to the scene, and can be used
3884
3881
  * to `getState` and `setState` of the entity.
@@ -4101,6 +4098,11 @@ declare module '@mappedin/mappedin-js/geojson/src/types' {
4101
4098
  * Fired when the user stops interacting with the map.
4102
4099
  */
4103
4100
  'user-interaction-end': undefined;
4101
+ /**
4102
+ * Fired when a geometry is in focus, meaning it occupies the area closest to the center of the screen. This will only be true for one geometry at a time.
4103
+ * Geometries can be added to the focus listener via `mapView.setState(.., { focusable: true })`.
4104
+ */
4105
+ 'geometry-in-focus': string | number | null;
4104
4106
  };
4105
4107
  /**
4106
4108
  * The payload of an event. See also {@link MapEvent}.
@@ -4111,7 +4113,7 @@ declare module '@mappedin/mappedin-js/geojson/src/types' {
4111
4113
  }
4112
4114
 
4113
4115
  declare module '@mappedin/mappedin-js/geojson/src/components/mesh' {
4114
- import type { Texture, BufferGeometry, LineSegments } from 'three';
4116
+ import type { Texture, BufferGeometry, LineSegments, Mesh } from 'three';
4115
4117
  import { BatchedMesh, Color, Vector3 } from 'three';
4116
4118
  import type { BatchedStandardMaterial } from '@mappedin/mappedin-js/geojson/src/systems/mesh-creation-and-optimization/batched-material';
4117
4119
  import type { Position } from '@mappedin/mappedin-js/geojson/src/types';
@@ -4167,10 +4169,15 @@ declare module '@mappedin/mappedin-js/geojson/src/components/mesh' {
4167
4169
  * Whether the geometry is outlined with a 30% darkened color. This effect adds lines around the geometry to make it stand out.
4168
4170
  */
4169
4171
  outline: boolean;
4172
+ /**
4173
+ * Whether the geometry should emit an event when focused on by the center of the camera
4174
+ */
4175
+ focusable: boolean;
4170
4176
  };
4171
4177
  export class MeshComponent {
4172
4178
  #private;
4173
4179
  mesh?: EntityBatchedMesh;
4180
+ focusMesh?: Mesh;
4174
4181
  outline?: LineSegments;
4175
4182
  readonly type = "geometry";
4176
4183
  instanceIndex: number;
@@ -4181,6 +4188,7 @@ declare module '@mappedin/mappedin-js/geojson/src/components/mesh' {
4181
4188
  get visible(): boolean;
4182
4189
  set visible(visible: boolean);
4183
4190
  setOpacity(opacity: number): void;
4191
+ focusable: boolean;
4184
4192
  color: Color;
4185
4193
  topColor: Color;
4186
4194
  setColor(color: string, topColor: string): void;
@@ -4209,7 +4217,7 @@ declare module '@mappedin/mappedin-js/geojson/src/components/custom' {
4209
4217
  /**
4210
4218
  * State representing a Custom Geometry
4211
4219
  */
4212
- export type CustomGeometryState = {
4220
+ export type ShapeState = {
4213
4221
  readonly id: string;
4214
4222
  readonly type: 'custom-geometry';
4215
4223
  /**
@@ -4346,17 +4354,20 @@ declare module '@mappedin/mappedin-js/geojson/src/renderer' {
4346
4354
  import { GeometryGroupObject3D } from '@mappedin/mappedin-js/geojson/src/entities/entity-group';
4347
4355
  import { DOMResizeSystem } from '@mappedin/mappedin-js/geojson/src/systems/dom-resize/system';
4348
4356
  import { Camera } from '@mappedin/mappedin-js/geojson/src/camera';
4349
- import { WatermarkSystem } from '@mappedin/mappedin-js/geojson/src/systems/watermark/system';
4357
+ import { type WatermarkOptions, WatermarkSystem } from '@mappedin/mappedin-js/geojson/src/systems/watermark/system';
4350
4358
  import { PanBoundsSystem } from '@mappedin/mappedin-js/geojson/src/systems/pan-bounds/system';
4351
4359
  import { HTMLControlsSystem } from '@mappedin/mappedin-js/geojson/src/systems/html-controls/system';
4352
- import { type CustomGeometryBuilder, type CustomGeometryState } from '@mappedin/mappedin-js/geojson/src/components/custom';
4360
+ import { type CustomGeometryBuilder, type ShapeState } from '@mappedin/mappedin-js/geojson/src/components/custom';
4353
4361
  import { CustomGeometrySystem } from '@mappedin/mappedin-js/geojson/src/systems/custom-geometry/system';
4354
4362
  import { OutlineInterpolationSystem } from '@mappedin/mappedin-js/geojson/src/systems/outline-interpolation/system';
4363
+ import { GeometryInFocusSystem } from '@mappedin/mappedin-js/geojson/src/systems/geometry-in-focus/system';
4355
4364
  import { OutdoorLayers } from '@mappedin/mappedin-js/geojson/src/systems/outdoor-layers/system';
4356
4365
  import { PathSystem } from '@mappedin/mappedin-js/geojson/src/systems/path';
4357
4366
  export type * from '@mappedin/mappedin-js/geojson/src/types';
4358
4367
  export const raycaster: Raycaster;
4359
4368
  export const DEFAULT_ZOOM_LEVEL = 18;
4369
+ export const DEFAULT_MIN_ZOOM_LEVEL = 12;
4370
+ export const DEFAULT_MAX_ZOOM_LEVEL = 22;
4360
4371
  export const DEFAULT_PITCH = 0;
4361
4372
  export const DEFAULT_BEARING = 0;
4362
4373
  /**
@@ -4382,6 +4393,8 @@ declare module '@mappedin/mappedin-js/geojson/src/renderer' {
4382
4393
  insetsPadding: InsetPadding;
4383
4394
  shouldMeasureCanvas: boolean;
4384
4395
  pixelRatio: number;
4396
+ canvasWidth: number;
4397
+ canvasHeight: number;
4385
4398
  };
4386
4399
  export type Systems = {
4387
4400
  cameraSystem: CameraSystem;
@@ -4406,6 +4419,7 @@ declare module '@mappedin/mappedin-js/geojson/src/renderer' {
4406
4419
  outlineInterpolationSystem: OutlineInterpolationSystem;
4407
4420
  outdoorLayersSystem: OutdoorLayers;
4408
4421
  pathSystem: PathSystem;
4422
+ geometryInFocusSystem: GeometryInFocusSystem;
4409
4423
  };
4410
4424
  export type MapViewState = {
4411
4425
  readonly type: 'map-view';
@@ -4458,7 +4472,7 @@ declare module '@mappedin/mappedin-js/geojson/src/renderer' {
4458
4472
  addCustomGeometry(id: string, feature: Feature<Point>, builder: CustomGeometryBuilder, style?: {
4459
4473
  visible?: boolean;
4460
4474
  altitude?: number;
4461
- }, parent?: EntityId<GroupContainerState> | string | number | null): EntityId<CustomGeometryState>;
4475
+ }, parent?: EntityId<GroupContainerState> | string | number | null): EntityId<ShapeState>;
4462
4476
  /**
4463
4477
  * Add a geometry group from GeoJSON data
4464
4478
  */
@@ -4479,6 +4493,12 @@ declare module '@mappedin/mappedin-js/geojson/src/renderer' {
4479
4493
  * Add a Path along a set of GeoJSON coordinates that can be animated.
4480
4494
  */
4481
4495
  addPath(geometry: FeatureCollection<Point, any>, options?: AddPathOptions, parent?: EntityId<GroupContainerState> | string | null): EntityId<PathState>;
4496
+ /**
4497
+ * Updates the watermark on the map.
4498
+ *
4499
+ * @param options {WatermarkOptions}
4500
+ */
4501
+ updateWatermark(options: Omit<WatermarkOptions, 'onClick'>): void;
4482
4502
  /**
4483
4503
  * @deprecated
4484
4504
  * @TODO: remove this method and do this in setstate instead
@@ -4515,9 +4535,9 @@ declare module '@mappedin/mappedin-js/geojson/src/renderer' {
4515
4535
  * Get the current state of the map view, or any entity that was added, regardless of whether it is visible in the scene
4516
4536
  */
4517
4537
  getState(): MapViewState;
4518
- getState<T extends EntityId<EntityState>>(geometryOrGeometryId: T): T extends EntityId<LabelState> ? LabelState : T extends EntityId<GeometryState> ? GeometryState : T extends EntityId<MarkerState> ? MarkerState : T extends EntityId<GeometryGroupState> ? GeometryGroupState : T extends EntityId<GroupContainerState> ? GroupContainerState : T extends EntityId<ModelState> ? ModelState : T extends EntityId<PathState> ? CustomGeometryState : T extends EntityId<CustomGeometryState> ? CustomGeometryState : EntityState;
4538
+ getState<T extends EntityId<EntityState>>(geometryOrGeometryId: T): T extends EntityId<LabelState> ? LabelState : T extends EntityId<GeometryState> ? GeometryState : T extends EntityId<MarkerState> ? MarkerState : T extends EntityId<GeometryGroupState> ? GeometryGroupState : T extends EntityId<GroupContainerState> ? GroupContainerState : T extends EntityId<ModelState> ? ModelState : T extends EntityId<PathState> ? ShapeState : T extends EntityId<ShapeState> ? ShapeState : EntityState;
4519
4539
  getState(geometryOrGeometryId?: Record<string | number, any> | string | number): EntityState;
4520
- getState<T extends EntityState>(geometryOrGeometryId: T['id']): T extends LabelState ? LabelState : T extends GeometryState ? GeometryState : T extends MarkerState ? MarkerState : T extends GeometryGroupState ? GeometryGroupState : T extends GroupContainerState ? GroupContainerState : T extends ModelState ? ModelState : T extends PathState ? CustomGeometryState : T extends CustomGeometryState ? PathState : EntityState;
4540
+ getState<T extends EntityState>(geometryOrGeometryId: T['id']): T extends LabelState ? LabelState : T extends GeometryState ? GeometryState : T extends MarkerState ? MarkerState : T extends GeometryGroupState ? GeometryGroupState : T extends GroupContainerState ? GroupContainerState : T extends ModelState ? ModelState : T extends PathState ? ShapeState : T extends ShapeState ? PathState : EntityState;
4521
4541
  /**
4522
4542
  * Set the state of the map view or any entity that was added, regardless of whether it is visible in the scene.
4523
4543
  */
@@ -4527,7 +4547,7 @@ declare module '@mappedin/mappedin-js/geojson/src/renderer' {
4527
4547
  setState<T extends EntityId<GeometryGroupState>>(object: T | T['id'], state: Partial<GeometryGroupState>): void;
4528
4548
  setState<T extends EntityId<GroupContainerState>>(object: T | T['id'], state: Partial<GroupContainerState>): void;
4529
4549
  setState<T extends EntityId<GeometryState>>(object: T | T['id'], state: Partial<GeometryState>): void;
4530
- setState<T extends EntityId<CustomGeometryState>>(object: T | T['id'], state: Partial<CustomGeometryState>): void;
4550
+ setState<T extends EntityId<ShapeState>>(object: T | T['id'], state: Partial<ShapeState>): void;
4531
4551
  setState<T extends EntityId<PathState>>(object: T | T['id'], state: Partial<PathState>): void;
4532
4552
  setState<T extends EntityId<ModelState>>(object: T | T['id'], state: Partial<ModelState>): void;
4533
4553
  setState<T extends EntityState>(object: T | T['id'], state: Partial<T>): void;
@@ -4722,12 +4742,14 @@ declare module '@mappedin/mappedin-js/geojson/src/camera' {
4722
4742
  * How far out the camera can zoom
4723
4743
  *
4724
4744
  * @param zoomLevel The minimum zoom level in mercator zoom level units.
4745
+ * @default 0
4725
4746
  */
4726
4747
  setMinZoomLevel(zoomLevel: number): void;
4727
4748
  /**
4728
4749
  * How far in the camera can zoom
4729
4750
  *
4730
4751
  * @param zoomLevel The maximum zoom level in mercator zoom level units.
4752
+ * @default Infinity
4731
4753
  */
4732
4754
  setMaxZoomLevel(zoomLevel: number): void;
4733
4755
  /**
@@ -4826,6 +4848,10 @@ declare module '@mappedin/mappedin-js/geojson/src/utils/collision-ranking-tier'
4826
4848
  export function convertNumberToCollisionRankingTier(rank: number): CollisionRankingTier;
4827
4849
  }
4828
4850
 
4851
+ declare module '@mappedin/mappedin-js/packages/geojson-navigator' {
4852
+ export * from '@mappedin/mappedin-js/packages/geojson-navigator/src';
4853
+ }
4854
+
4829
4855
  declare module '@mappedin/mappedin-js/geojson/src/utils' {
4830
4856
  import type { Box3, Camera as THREECamera } from 'three';
4831
4857
  import { Box2 } from 'three';
@@ -4973,6 +4999,7 @@ declare module '@mappedin/mappedin-js/geojson/src/services/renderer' {
4973
4999
 
4974
5000
  declare module '@mappedin/mappedin-js/geojson/src/systems/watermark/system' {
4975
5001
  import type { PerspectiveCamera } from 'three';
5002
+ import { PubSub } from '@packages/internal/common';
4976
5003
  import type { Geometry2D } from '@mappedin/mappedin-js/geojson/src/entities';
4977
5004
  import type { QuadTree } from '@packages/internal/quad-tree';
4978
5005
  export type WatermarkPosition = 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right' | 'center' | 'top' | 'bottom' | 'left' | 'right';
@@ -5012,10 +5039,13 @@ declare module '@mappedin/mappedin-js/geojson/src/systems/watermark/system' {
5012
5039
  */
5013
5040
  onClick?: () => void;
5014
5041
  };
5015
- export class WatermarkSystem {
5042
+ export class WatermarkSystem extends PubSub<{
5043
+ 'texture-loaded': void;
5044
+ }> {
5016
5045
  #private;
5017
- options: Required<WatermarkOptions>;
5018
5046
  dirty: boolean;
5047
+ get options(): WatermarkOptions;
5048
+ set options(options: WatermarkOptions);
5019
5049
  get icon(): string;
5020
5050
  constructor(cameraObject: PerspectiveCamera, canvasWidth: number, canvasHeight: number, rendererState: any, options?: WatermarkOptions);
5021
5051
  get width(): number;
@@ -5327,31 +5357,31 @@ declare module '@mappedin/mappedin-js/mappedin-js/src/map-view-objects/path' {
5327
5357
  }
5328
5358
  }
5329
5359
 
5330
- declare module '@mappedin/mappedin-js/mappedin-js/src/map-view-objects/custom-geometry' {
5360
+ declare module '@mappedin/mappedin-js/mappedin-js/src/map-view-objects/shape' {
5331
5361
  /**
5332
- * Class representing a GeoJSON geometry on the {@link MapView}.
5362
+ * Class representing GeoJSON shape on the {@link MapView}.
5333
5363
  *
5334
5364
  */
5335
- export class CustomGeometry {
5365
+ export class Shape {
5336
5366
  /**
5337
- * The label's id
5367
+ * id of Shape
5338
5368
  */
5339
5369
  readonly id: string;
5340
5370
  /**
5341
5371
  * @internal
5342
5372
  */
5343
- static readonly __type = "CustomGeometry";
5373
+ static readonly __type = "Shape";
5344
5374
  /**
5345
5375
  * @internal
5346
5376
  */
5347
- readonly __type = "CustomGeometry";
5377
+ readonly __type = "Shape";
5348
5378
  /**
5349
- * Checks if the provided instance is of type CustomGeometry.
5379
+ * Checks if the provided instance is of type Shape.
5350
5380
  *
5351
5381
  * @param instance The instance to check.
5352
- * @returns {boolean} True if the instance is a CustomGeometry, false otherwise.
5382
+ * @returns {boolean} True if the instance is a Shape, false otherwise.
5353
5383
  */
5354
- static is(instance: object): instance is CustomGeometry;
5384
+ static is(instance: object): instance is Shape;
5355
5385
  /**
5356
5386
  * @internal
5357
5387
  */
@@ -5360,7 +5390,7 @@ declare module '@mappedin/mappedin-js/mappedin-js/src/map-view-objects/custom-ge
5360
5390
  }
5361
5391
 
5362
5392
  declare module '@mappedin/mappedin-js/mappedin-js/src/api-geojson/api' {
5363
- import type { Position, RendererCore } from '@mappedin/core-sdk';
5393
+ import type { Position, RendererCore, WatermarkOptions } from '@mappedin/core-sdk';
5364
5394
  import { type TShow3DMapOptions } from '@mappedin/mappedin-js/mappedin-js/src';
5365
5395
  import type MapData from '@mappedin/mappedin-js/mappedin-js/src/map-data';
5366
5396
  import { Floor } from '@mappedin/mappedin-js/mappedin-js/src/map-data-objects';
@@ -5379,7 +5409,7 @@ declare module '@mappedin/mappedin-js/mappedin-js/src/api-geojson/api' {
5379
5409
  import { Paths } from '@mappedin/mappedin-js/mappedin-js/src/api-geojson/paths';
5380
5410
  import { BlueDot } from '@mappedin/mappedin-js/mappedin-js/src/api-geojson/blue-dot/blue-dot';
5381
5411
  import type { TFloorChangeReason } from '@mappedin/mappedin-js/mappedin-js/src/events';
5382
- import { CustomGeometries } from '@mappedin/mappedin-js/mappedin-js/src/api-geojson/custom-geometries';
5412
+ import { Shapes } from '@mappedin/mappedin-js/mappedin-js/src/api-geojson/shapes';
5383
5413
  import { Style } from '@mappedin/mappedin-js/mappedin-js/src/api-geojson/style';
5384
5414
  import Outdoor from '@mappedin/mappedin-js/mappedin-js/src/api-geojson/outdoor';
5385
5415
  export class GeoJsonApi {
@@ -5402,7 +5432,7 @@ declare module '@mappedin/mappedin-js/mappedin-js/src/api-geojson/api' {
5402
5432
  Navigation: Navigation;
5403
5433
  Outdoor: Outdoor;
5404
5434
  BlueDot: BlueDot;
5405
- CustomGeometries: CustomGeometries;
5435
+ Shapes: Shapes;
5406
5436
  Style: Style;
5407
5437
  constructor(rendererCore: RendererCore, mapView: MapView);
5408
5438
  updateState<T extends Space | MapObject | Label | Marker | 'walls' | (string & NonNullable<unknown>)>(target: T, state: TUpdateState<T>): void;
@@ -5415,6 +5445,7 @@ declare module '@mappedin/mappedin-js/mappedin-js/src/api-geojson/api' {
5415
5445
  collapse(): Promise<void> | undefined;
5416
5446
  addMap(mapData: MapData, options?: TShow3DMapOptions): Promise<MapData>;
5417
5447
  setFloor(floor: Floor | string, reason?: TFloorChangeReason): void;
5448
+ updateWatermark(options: Omit<WatermarkOptions, 'onClick'>): void;
5418
5449
  get currentFloor(): Floor;
5419
5450
  getState<T extends Space | MapObject | Label | Marker | Model | string>(target: T): TGetState<T> | undefined;
5420
5451
  setHoverColor(c: string): void;
@@ -5514,6 +5545,7 @@ declare module '@mappedin/mappedin-js/mappedin-js/src/api-geojson/camera' {
5514
5545
  * Update the minimum zoom level of the camera in mercator zoom levels.
5515
5546
  * @param zoomLevel The new minimum zoom level.
5516
5547
  * @see https://wiki.openstreetmap.org/wiki/Zoom_levels
5548
+ * @default 22
5517
5549
  */
5518
5550
  setMinZoomLevel: (zoomLevel: number) => void;
5519
5551
  /**
@@ -5526,6 +5558,7 @@ declare module '@mappedin/mappedin-js/mappedin-js/src/api-geojson/camera' {
5526
5558
  * Update the maximum zoom level of the camera in mercator zoom levels.
5527
5559
  * @param zoomLevel The new maximum zoom level.
5528
5560
  * @see https://wiki.openstreetmap.org/wiki/Zoom_levels
5561
+ * @default 12
5529
5562
  */
5530
5563
  setMaxZoomLevel: (zoomLevel: number) => void;
5531
5564
  }
@@ -5938,7 +5971,7 @@ declare module '@mappedin/mappedin-js/mappedin-js/src/api-geojson/map-object' {
5938
5971
  import { StackedMaps } from '@mappedin/mappedin-js/mappedin-js/src/api-geojson/stacked-maps/stacked-maps';
5939
5972
  import type { TFloorChangeReason } from '@mappedin/mappedin-js/mappedin-js/src/events';
5940
5973
  import type { FeatureCollection, LineString, MultiPolygon, Polygon } from 'geojson';
5941
- import type { CustomGeometry } from '@mappedin/mappedin-js/mappedin-js/src/map-view-objects';
5974
+ import type { Shape } from '@mappedin/mappedin-js/mappedin-js/src/map-view-objects';
5942
5975
  export class GeojsonApiMapObject extends PubSub<{
5943
5976
  'floor-change': {
5944
5977
  reason?: TFloorChangeReason;
@@ -5976,11 +6009,11 @@ declare module '@mappedin/mappedin-js/mappedin-js/src/api-geojson/map-object' {
5976
6009
  Exporter: {
5977
6010
  getCurrentSceneGLTF: (options: GLTFExportOptions) => Promise<Blob>;
5978
6011
  };
5979
- CustomGeometries: {
6012
+ Shapes: {
5980
6013
  add: <T extends FeatureCollection<Polygon | MultiPolygon | LineString, any>>(geometry: T, style: T extends FeatureCollection<LineString, any> ? LineStyle : PaintStyle, opts: {
5981
6014
  floorId?: string;
5982
6015
  }) => string;
5983
- remove: (customGeometry: CustomGeometry) => string;
6016
+ remove: (customGeometry: Shape) => string;
5984
6017
  };
5985
6018
  Labels: {
5986
6019
  all: ({ onCreate }: {
@@ -6757,6 +6790,24 @@ declare module '@mappedin/mappedin-js/geojson/src/systems/outline-interpolation/
6757
6790
  }
6758
6791
  }
6759
6792
 
6793
+ declare module '@mappedin/mappedin-js/geojson/src/systems/geometry-in-focus/system' {
6794
+ import { PubSub } from '@packages/internal/common';
6795
+ import type { RendererState } from '@mappedin/mappedin-js/geojson/src/renderer';
6796
+ import { type PerspectiveCamera } from 'three';
6797
+ export class GeometryInFocusSystem extends PubSub<{
6798
+ 'geometry-in-focus': string | number | null;
6799
+ }> {
6800
+ #private;
6801
+ cameraDirty: boolean;
6802
+ focusablesDirty: boolean;
6803
+ constructor(state: RendererState, camera: PerspectiveCamera);
6804
+ resize(): void;
6805
+ update: () => void;
6806
+ updateRaf(): void;
6807
+ destroy(): void;
6808
+ }
6809
+ }
6810
+
6760
6811
  declare module '@mappedin/mappedin-js/geojson/src/systems/outdoor-layers/system' {
6761
6812
  import type { Map } from '@packages/internal/outdoor-context-v4';
6762
6813
  import type { Position } from '@mappedin/mappedin-js/geojson/src/renderer';
@@ -6772,6 +6823,15 @@ declare module '@mappedin/mappedin-js/geojson/src/systems/path' {
6772
6823
  export { PathSystem } from '@mappedin/mappedin-js/geojson/src/systems/path/system';
6773
6824
  }
6774
6825
 
6826
+ declare module '@mappedin/mappedin-js/packages/geojson-navigator/src' {
6827
+ export { Navigator } from '@mappedin/mappedin-js/packages/geojson-navigator/src/navigator';
6828
+ export type { SimplifyDirectionsOptions } from '@mappedin/mappedin-js/packages/geojson-navigator/src/navigator/navigator';
6829
+ export type { NodeCollection, NodeProperties, NodeFeature, NodeNeighbor } from '@mappedin/mappedin-js/packages/geojson-navigator/src/types/node';
6830
+ export type { ObstructionCollection, ObstructionProperties, ObstructionFeature } from '@mappedin/mappedin-js/packages/geojson-navigator/src/types/obstruction';
6831
+ export type { DirectionsCollection, DirectionProperties, DirectionFeature } from '@mappedin/mappedin-js/packages/geojson-navigator/src/types/directions';
6832
+ export type { CoordinateFeature, CoordinateProperties } from '@mappedin/mappedin-js/packages/geojson-navigator/src/types/coordinate';
6833
+ }
6834
+
6775
6835
  declare module '@mappedin/mappedin-js/geojson/src/utils/bounding-box' {
6776
6836
  import { type Box3, Vector3 } from 'three';
6777
6837
  export function getCornersOfBoundingBox(boundingBox: Box3): Vector3[];
@@ -7018,6 +7078,7 @@ declare module '@mappedin/mappedin-js/geojson/src/systems/interactions/system' {
7018
7078
  hasTouched: boolean;
7019
7079
  onPointerMoveRaf: (event: PointerEvent) => void;
7020
7080
  tapsControl: TapsController;
7081
+ handleHover(e?: PointerEvent): void;
7021
7082
  dirty3D: boolean;
7022
7083
  get _hitBoxes(): {
7023
7084
  entities: (Object3D | EntityMesh<Geometry3D> | EntityBatchedMesh)[];
@@ -7157,26 +7218,28 @@ declare module '@mappedin/mappedin-js/geojson/src/systems/camera/system' {
7157
7218
  * This is actually the minium distance the camera can get from it's anchor on the ground. May be worth changing if your map has very tall buildings to avoid the camera clipping through them.
7158
7219
  *
7159
7220
  * @property minZoomAltitude {Number}
7160
- * @default 5
7221
+ * @default 0
7161
7222
  */
7162
7223
  minZoomAltitude: number;
7224
+ /**
7225
+ * Maximum distance the camera can get from it's anchor on the ground. Setting this too high will result in parts of the map falling out of the camera's clipping plane and disappearing.
7226
+ *
7227
+ * @property maxZoomAltitude {Number}
7228
+ * @default Infinity
7229
+ */
7230
+ maxZoomAltitude: number;
7163
7231
  /**
7164
7232
  * How far the camera can zoom in towards the ground.
7165
7233
  *
7166
7234
  * This is equivalent to the minZoomAltitude property in mercator zoom level units.
7235
+ * @default 0
7167
7236
  */
7168
7237
  get maxZoomLevel(): number;
7169
7238
  /**
7170
7239
  * Sets distance the camera can zoom in towards the ground.
7240
+ * @default Infinity
7171
7241
  */
7172
7242
  setMaxZoomLevel(zoomLevel: number): void;
7173
- /**
7174
- * Maximum distance the camera can get from it's anchor on the ground. Setting this too high will result in parts of the map falling out of the camera's clipping plane and disappearing.
7175
- *
7176
- * @property maxZoomAltitude {Number}
7177
- * @default 10000
7178
- */
7179
- maxZoomAltitude: number;
7180
7243
  /**
7181
7244
  * How far the camera can zoom out away from the ground.
7182
7245
  *
@@ -7187,27 +7250,11 @@ declare module '@mappedin/mappedin-js/geojson/src/systems/camera/system' {
7187
7250
  * Sets distance the camera can zoom away from the ground.
7188
7251
  */
7189
7252
  setMinZoomLevel(zoomLevel: number): void;
7190
- /**
7191
- * Initial min zoom; zoom cannot be restricted beyond this.
7192
- *
7193
- * @property initialMinZoom {Number}
7194
- * @default 5
7195
- */
7196
- initialMinZoom: number;
7197
- /**
7198
- * Initial max zoom; zoom cannot be restricted beyond this.
7199
- *
7200
- * @property initialMaxZoom {Number}
7201
- * @default 10000
7202
- */
7203
- initialMaxZoom: number;
7204
7253
  /**
7205
7254
  * ignoreZoomLimits; use with caution for special effects
7206
7255
  * @default false
7207
7256
  */
7208
7257
  ignoreZoomLimits: boolean;
7209
- minExpandedZoom: number;
7210
- maxExpandedZoom: number;
7211
7258
  /**
7212
7259
  * Multiplier for min and max zoom, for convenience.
7213
7260
  *
@@ -7460,20 +7507,6 @@ declare module '@mappedin/mappedin-js/geojson/src/systems/camera/system' {
7460
7507
  * @param zoom {Number} The distance to increase or decrease the zoom.
7461
7508
  */
7462
7509
  zoom: (zoomDelta: number) => void;
7463
- /**
7464
- * Expands the zoom limits to allow zooming to the specified distance.
7465
- *
7466
- * @param zoom {Number} The distance to allow zooming to.
7467
- * @param buffer {Number} The factor by which the user should be able to zoom beyond the specified distance.
7468
- */
7469
- expandZoomLimits: (zoom: number, buffer: number) => void;
7470
- /**
7471
- * Restricts the zoom limits, but will not restrict beyond the current zoom level.
7472
- *
7473
- * @param zoom {Number} The number to limit zooming to.
7474
- * @param buffer {Number} The factor by which the user should be able to zoom beyond the specified distance.
7475
- */
7476
- restrictZoomLimits: (zoom: number, buffer: number) => void;
7477
7510
  /**
7478
7511
  * Returns the current projection scale factor.
7479
7512
  * @param FOV {number} Field of view
@@ -15543,6 +15576,223 @@ declare module '@mappedin/mappedin-js/geojson/src/systems/path/system' {
15543
15576
  }
15544
15577
  }
15545
15578
 
15579
+ declare module '@mappedin/mappedin-js/packages/geojson-navigator/src/navigator' {
15580
+ export * from '@mappedin/mappedin-js/packages/geojson-navigator/src/navigator/navigator';
15581
+ }
15582
+
15583
+ declare module '@mappedin/mappedin-js/packages/geojson-navigator/src/navigator/navigator' {
15584
+ import type { Position, Feature, MultiPolygon, Polygon } from 'geojson';
15585
+ import type { NodeCollection, NodeFeature } from '@mappedin/mappedin-js/packages/geojson-navigator/src/types/node';
15586
+ import type { ObstructionCollection } from '@mappedin/mappedin-js/packages/geojson-navigator/src/types/obstruction';
15587
+ import type { DirectionsCollection } from '@mappedin/mappedin-js/packages/geojson-navigator/src/types/directions';
15588
+ import type { CoordinateFeature } from '@mappedin/mappedin-js/packages/geojson-navigator/src/types/coordinate';
15589
+ /**
15590
+ * Options for simplifying directions in the Navigator class.
15591
+ */
15592
+ export type SimplifyDirectionsOptions = {
15593
+ /**
15594
+ * Enable or disable simplifying.
15595
+ */
15596
+ enabled: boolean;
15597
+ /**
15598
+ * The radius of the buffer around the path to consider when simplifying, in meters.
15599
+ * @default 0.7
15600
+ */
15601
+ bufferRadius?: number;
15602
+ };
15603
+ /**
15604
+ * Defines the special zone for navigation operations.
15605
+ */
15606
+ export type DirectionsZone = {
15607
+ geometry: Feature<MultiPolygon | Polygon>;
15608
+ /**
15609
+ * The additional cost for navigation through the zone.
15610
+ */
15611
+ cost: number;
15612
+ /**
15613
+ *
15614
+ * Additional property specific to the navigator based on the 'groupBy' option.
15615
+ */
15616
+ [index: string]: any;
15617
+ };
15618
+ export class Navigator {
15619
+ /**
15620
+ * Constructs a Navigator instance to manage pathfinding with optional obstructions and grouping features.
15621
+ *
15622
+ * @param {NodeCollection} nodes - Collection of nodes for the navigation graph.
15623
+ * @param {ObstructionCollection} [obstructions] - Optional collection of obstructions that could block paths.
15624
+ * @param {string} [groupBy] - Optional property name to group nodes and paths for differentiated processing.
15625
+ */
15626
+ constructor({ nodes, obstructions, groupBy, }: {
15627
+ nodes: NodeCollection;
15628
+ obstructions?: ObstructionCollection;
15629
+ groupBy?: string;
15630
+ });
15631
+ findNearestNode: (feature: CoordinateFeature) => NodeFeature | null;
15632
+ /**
15633
+ * Calculates and returns a set of directions from origin nodes to destination nodes, including detailed properties.
15634
+ *
15635
+ * @param {string[]} originIds - IDs of origin nodes.
15636
+ * @param {string[]} destinationNodeIds - IDs of destination nodes.
15637
+ * @param {string[]} [excludedNodeIds] - IDs of nodes to exclude from pathfinding.
15638
+ * @param {SimplifyDirectionsOptions} [simplify] - Options to simplify the pathfinding result.
15639
+ * @returns {DirectionsCollection} A collection of directional features representing the path.
15640
+ */
15641
+ getDirections({ zones: directionsZones, originIds, destinationNodeIds, excludedNodeIds, simplify, }: {
15642
+ originIds: string[];
15643
+ destinationNodeIds: string[];
15644
+ zones?: DirectionsZone[];
15645
+ excludedNodeIds?: string[];
15646
+ simplify?: SimplifyDirectionsOptions;
15647
+ }): DirectionsCollection;
15648
+ /**
15649
+ * Calculates the approximate distance between two geographic coordinates on Earth's surface.
15650
+ *
15651
+ * This function uses the equirectangular approximation method to compute the distance, which simplifies
15652
+ * the math and speeds up calculations, but is less accurate over long distances compared to other methods
15653
+ * like the haversine formula.
15654
+ *
15655
+ * @param {Position} point1 - The first point's longitude and latitude as [longitude, latitude].
15656
+ * @param {Position} point2 - The second point's longitude and latitude as [longitude, latitude].
15657
+ * @return
15658
+ * @return {number} The approximate distance between the two points in meters.
15659
+ */
15660
+ getDistance: (point1: Position, point2: Position) => number;
15661
+ /**
15662
+ * Calculates the angle between two geographic coordinates.
15663
+ *
15664
+ * @param {Position} point1 - The first point's longitude and latitude as [longitude, latitude].
15665
+ * @param {Position} point2 - The second point's longitude and latitude as [longitude, latitude].
15666
+ * @hidden
15667
+ *
15668
+ * @return {number} The angle in radians, calculated clockwise from the north between the two points specified.
15669
+ */
15670
+ getAngle: (point1: Position, point2: Position) => number;
15671
+ }
15672
+ }
15673
+
15674
+ declare module '@mappedin/mappedin-js/packages/geojson-navigator/src/types/node' {
15675
+ import type { Feature, FeatureCollection, Point } from 'geojson';
15676
+ /**
15677
+ * The neighboring node with associated weight.
15678
+ */
15679
+ export type NodeNeighbor = {
15680
+ id: string;
15681
+ weight: number;
15682
+ };
15683
+ /**
15684
+ * Properties specific to node features in a geospatial context.
15685
+ * Each node includes a mandatory unique identifier and supports additional custom properties.
15686
+ */
15687
+ export type NodeProperties = {
15688
+ /**
15689
+ * Unique identifier for the node.
15690
+ */
15691
+ id: string;
15692
+ /**
15693
+ * An array of neighboring nodes with associated weights.
15694
+ */
15695
+ neighbors: NodeNeighbor[];
15696
+ /**
15697
+ * Additional property specific to the navigator based on the 'groupBy' option.
15698
+ * */
15699
+ [name: string]: any;
15700
+ };
15701
+ /**
15702
+ * A GeoJSON feature collection that groups multiple nodes, each represented as a point.
15703
+ * This structure is commonly used in mapping, routing, and network analysis applications.
15704
+ */
15705
+ export type NodeCollection = FeatureCollection<Point, NodeProperties>;
15706
+ /**
15707
+ * A GeoJSON feature representing a node as a point with associated properties.
15708
+ * Nodes are critical for defining specific locations in network-based analyses, such as transportation networks,
15709
+ * utility networks, or any kind of spatial network analysis.
15710
+ */
15711
+ export type NodeFeature = Feature<Point, NodeProperties>;
15712
+ }
15713
+
15714
+ declare module '@mappedin/mappedin-js/packages/geojson-navigator/src/types/obstruction' {
15715
+ import type { LineString, FeatureCollection, Polygon, Feature } from 'geojson';
15716
+ /**
15717
+ * Properties specific to obstruction features in a geospatial context.
15718
+ * Includes a mandatory unique identifier and allows for any additional custom properties.
15719
+ */
15720
+ export type ObstructionProperties = {
15721
+ /**
15722
+ * Unique identifier for the obstruction.
15723
+ */
15724
+ id: string;
15725
+ /**
15726
+ * Additional property specific to the navigator based on the 'groupBy' option.
15727
+ * */
15728
+ [name: string]: any;
15729
+ };
15730
+ /**
15731
+ * A GeoJSON feature collection that groups multiple obstruction features, which can be line strings or polygons.
15732
+ * This is typically used to represent physical barriers or areas where access is restricted.
15733
+ */
15734
+ export type ObstructionCollection = FeatureCollection<LineString | Polygon, ObstructionProperties>;
15735
+ /**
15736
+ * A GeoJSON feature representing an obstruction, which can be either a line string or a polygon.
15737
+ * This type is crucial for mapping and managing areas that impede or restrict movement, such as barriers or restricted zones.
15738
+ *
15739
+ */
15740
+ export type ObstructionFeature = Feature<LineString | Polygon, ObstructionProperties>;
15741
+ }
15742
+
15743
+ declare module '@mappedin/mappedin-js/packages/geojson-navigator/src/types/directions' {
15744
+ import type { Feature, FeatureCollection, Point } from 'geojson';
15745
+ /**
15746
+ * Properties specific to directional features in a navigation context.
15747
+ * Includes an identifier, optional angle and distance, and allows for any additional properties.
15748
+ */
15749
+ export type DirectionProperties = {
15750
+ /**
15751
+ * Unique identifier for the direction.
15752
+ */
15753
+ id: string;
15754
+ /**
15755
+ * An angle between this point and the destination, in radians.
15756
+ */
15757
+ angle?: number;
15758
+ /**
15759
+ * Distance to the next point, in meters.
15760
+ */
15761
+ distance?: number;
15762
+ /**
15763
+ * Group id which the direction belongs to (e.g. floor, building, etc).
15764
+ * It's based on the groupBy property of the navigator.
15765
+ */
15766
+ groupBy?: string;
15767
+ };
15768
+ /**
15769
+ * A GeoJSON feature representing a point with properties tailored for navigation directions.
15770
+ */
15771
+ export type DirectionFeature = Feature<Point, DirectionProperties>;
15772
+ /**
15773
+ * A GeoJSON feature collection that groups multiple directional features, often used to represent a route or path.
15774
+ */
15775
+ export type DirectionsCollection = FeatureCollection<Point, DirectionProperties>;
15776
+ }
15777
+
15778
+ declare module '@mappedin/mappedin-js/packages/geojson-navigator/src/types/coordinate' {
15779
+ import type { Feature, Point } from 'geojson';
15780
+ /**
15781
+ * Properties specific to node features in a geospatial context.
15782
+ * Each node includes a mandatory unique identifier and supports additional custom properties.
15783
+ */
15784
+ export type CoordinateProperties = {
15785
+ /**
15786
+ * Additional property specific to the navigator based on the 'groupBy' option.
15787
+ * */
15788
+ [name: string]: any;
15789
+ };
15790
+ /**
15791
+ * A GeoJSON feature representing a coordinate as a point with associated properties.
15792
+ */
15793
+ export type CoordinateFeature = Feature<Point, CoordinateProperties>;
15794
+ }
15795
+
15546
15796
  declare module '@mappedin/mappedin-js/geojson/src/entities/utils' {
15547
15797
  import type { CollisionRankingTier, GeometryState, LabelState, PathState, RendererCore } from '@mappedin/mappedin-js/geojson/src';
15548
15798
  import type { MarkerState } from '@mappedin/mappedin-js/geojson/src/components/marker';