@mappedin/mappedin-js 6.0.1-beta.13 → 6.0.1-beta.15

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.
@@ -11,8 +11,8 @@
11
11
  // ../mappedin-js/@packages/internal/geojson-navigator
12
12
  // ../mappedin-js/@tweenjs/tween.js
13
13
  // ../mappedin-js/@mappedin/mvf/dist/locale
14
- // ../mappedin-js/zod
15
14
  // ../mappedin-js/three
15
+ // ../mappedin-js/zod
16
16
  // ../mappedin-js/@packages/internal/shave-text/shave-text
17
17
  // ../mappedin-js/@turf/turf
18
18
  // ../mappedin-js/@packages/internal/quad-tree
@@ -356,7 +356,7 @@ declare module '@mappedin/mappedin-js' {
356
356
  export { parseMVF, unzipMVF, enableTestMode };
357
357
  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, };
358
358
  export type * from 'geojson';
359
- 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, TBlueDotOptions, } from '@mappedin/mappedin-js/mappedin-js/src/types';
359
+ 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, TBlueDotOptions, TBlueDotPositionUpdate, } from '@mappedin/mappedin-js/mappedin-js/src/types';
360
360
  export { WALLS, DOORS } from '@mappedin/mappedin-js/mappedin-js/src/types';
361
361
  export type { Label, Marker, Path, Shape, CameraTransform, Model } from '@mappedin/mappedin-js/mappedin-js/src/map-view-objects';
362
362
  export type { Navigation, TNavigationOptions } from '@mappedin/mappedin-js/mappedin-js/src/navigation';
@@ -568,7 +568,18 @@ declare module '@mappedin/mappedin-js/mappedin-js/src/map-data' {
568
568
  * @example
569
569
  * const directions = await map.getDirections(space1, space2);
570
570
  */
571
- getDirections: (from: TNavigationTarget | TNavigationTarget[], to: TNavigationTarget | (TNavigationTarget | TNavigationTarget[])[], options?: TGetDirectionsOptions) => Directions | Directions[] | undefined;
571
+ getDirections: (from: TNavigationTarget | TNavigationTarget[], to: TNavigationTarget | TNavigationTarget[], options?: TGetDirectionsOptions) => Directions | undefined;
572
+ /**
573
+ * Retrieves directions ({@link Directions}) from one navigable point ({@link TNavigationTarget}) to multiple destination points on the map.
574
+ *
575
+ * @param from The starting point for navigation.
576
+ * @param to The destination points.
577
+ * @param options Optional parameters for getting directions.
578
+ * @returns Directions from the start to the destination points.
579
+ * @example
580
+ * const directions = await map.getDirections(space1, [space2, space3]);
581
+ */
582
+ getDirectionsMultiDestination: (from: TNavigationTarget, to: (TNavigationTarget | TNavigationTarget[])[], options?: TGetDirectionsOptions) => Directions[] | undefined;
572
583
  /**
573
584
  * Retrieves the distance between two navigable points ({@link TNavigationTarget}) on the map.
574
585
  *
@@ -599,7 +610,7 @@ declare module '@mappedin/mappedin-js/mappedin-js/src/events' {
599
610
  import type { ClickPayload } from '@mappedin/core-sdk';
600
611
  import type { TStackedMapsEvents } from '@mappedin/mappedin-js/mappedin-js/src/api-geojson/stacked-maps/stacked-maps';
601
612
  import type { Coordinate, Floor, MapObject, Space } from '@mappedin/mappedin-js/mappedin-js/src/map-data-objects';
602
- import type { Label, Marker, Model } from '@mappedin/mappedin-js/mappedin-js/src/map-view-objects';
613
+ import type { Label, Marker, Model, Path } from '@mappedin/mappedin-js/mappedin-js/src/map-view-objects';
603
614
  import type { CameraTransform } from '@mappedin/mappedin-js/mappedin-js/src/map-view-objects/camera-transform';
604
615
  export type TFloorChangeReason = '' | 'blue-dot-floor-change' | 'elevation-change';
605
616
  export type TClickPayload = {
@@ -607,6 +618,10 @@ declare module '@mappedin/mappedin-js/mappedin-js/src/events' {
607
618
  * The coordinate of the interaction.
608
619
  */
609
620
  coordinate: Coordinate;
621
+ /**
622
+ * The interactive paths which the user interaction passed through.
623
+ */
624
+ paths: Path[];
610
625
  /**
611
626
  * The interactive spaces which the user interaction passed through.
612
627
  */
@@ -902,7 +917,10 @@ declare module '@mappedin/mappedin-js/mappedin-js/src/map-data-objects' {
902
917
  * change the langauge of the data objects in mapdata
903
918
  */
904
919
  changeLanguage(languageCode: string): Promise<void>;
905
- getDirections: (from: TNavigationTarget | TNavigationTarget[], to: TNavigationTarget | (TNavigationTarget | TNavigationTarget[])[], opt?: TGetDirectionsOptions) => Directions | Directions[] | undefined;
920
+ getDirectionsMultiDestination: (from: TNavigationTarget | TNavigationTarget[], to: TNavigationTarget | (TNavigationTarget | TNavigationTarget[])[], opt?: TGetDirectionsOptions) => Directions | Directions[] | undefined;
921
+ getDirections: (from: TNavigationTarget | TNavigationTarget[], to: TNavigationTarget | (TNavigationTarget | TNavigationTarget[])[], opt?: TGetDirectionsOptions & {
922
+ multiSegment?: true;
923
+ }) => Directions | Directions[] | undefined;
906
924
  getDistance(from: Space | Door | Coordinate | MapObject | PointOfInterest | Annotation | Node | EnterpriseLocation, to: Space | Door | Coordinate | MapObject | PointOfInterest | Annotation | Node | EnterpriseLocation): number;
907
925
  toJSONBundle({ downloadLanguagePacks, }?: {
908
926
  downloadLanguagePacks?: boolean;
@@ -1091,7 +1109,16 @@ declare module '@mappedin/mappedin-js/mappedin-js/src/map-view' {
1091
1109
  * @example
1092
1110
  * const directions = await map.getDirections(space1, space2);
1093
1111
  */
1094
- getDirections: (from: TNavigationTarget | TNavigationTarget[], to: TNavigationTarget | (TNavigationTarget | TNavigationTarget[])[], options?: TGetDirectionsOptions) => Directions | Directions[] | undefined;
1112
+ getDirections: (from: TNavigationTarget | TNavigationTarget[], to: TNavigationTarget | TNavigationTarget[], options?: TGetDirectionsOptions) => Directions | undefined;
1113
+ /**
1114
+ * Retrieves directions ({@link Directions}) from one navigable point ({@link TNavigationTarget}) to multiple destination points on the map.
1115
+ *
1116
+ * @param from The starting point for navigation.
1117
+ * @param to The destination points.
1118
+ * @param options Optional parameters for getting directions.
1119
+ * @returns Directions from the start to the destination points.
1120
+ */
1121
+ getDirectionsMultiDestination: (from: TNavigationTarget, to: (TNavigationTarget | TNavigationTarget[])[], options?: TGetDirectionsOptions) => Directions[] | undefined;
1095
1122
  /**
1096
1123
  * Retrieves the distance between two navigable points ({@link TNavigationTarget}) on the map.
1097
1124
  *
@@ -1247,6 +1274,9 @@ declare module '@mappedin/mappedin-js/mappedin-js/src/types' {
1247
1274
  export type DeepRequired<T> = Required<{
1248
1275
  [K in keyof T]: T[K] extends Required<T[K]> ? T[K] : DeepRequired<T[K]>;
1249
1276
  }>;
1277
+ export type DeepPartial<T> = Partial<{
1278
+ [K in keyof T]: T[K] extends Partial<T[K]> ? DeepPartial<T[K]> : T[K];
1279
+ }>;
1250
1280
  export type CancellablePromise<T> = {
1251
1281
  promise: Promise<T>;
1252
1282
  cancel: () => void;
@@ -1573,10 +1603,12 @@ declare module '@mappedin/mappedin-js/mappedin-js/src/types' {
1573
1603
  left: number;
1574
1604
  };
1575
1605
  };
1606
+ export type TCameraFocusOnTargets = Floor | Space | Coordinate | MapObject | Connection | PointOfInterest | Door | Annotation | Node;
1576
1607
  /**
1577
1608
  * Defines the target for the {@link Camera} focus operation.
1609
+ * @interface
1578
1610
  */
1579
- export type TCameraFocusOnTarget = Floor | Space | Coordinate | MapObject | Connection | PointOfInterest | Door | Annotation | Node | (Floor | Space | Coordinate | MapObject | Connection | PointOfInterest | Door | Node)[];
1611
+ export type TCameraFocusOnTarget = TCameraFocusOnTargets | TCameraFocusOnTargets[];
1580
1612
  /**
1581
1613
  * Defines the target for camera operations.
1582
1614
  */
@@ -1867,12 +1899,6 @@ declare module '@mappedin/mappedin-js/mappedin-js/src/types' {
1867
1899
  * Options for controlling the behavior of the {@link Directions}.
1868
1900
  */
1869
1901
  export type TGetDirectionsOptions = {
1870
- /**
1871
- * If true directions will be shown as a multisegment route
1872
- *
1873
- * @default false
1874
- */
1875
- multiSegment?: boolean;
1876
1902
  /**
1877
1903
  * If true directions will only take accessible routes
1878
1904
  *
@@ -2098,16 +2124,16 @@ declare module '@mappedin/mappedin-js/mappedin-js/src/types' {
2098
2124
  opacity?: number;
2099
2125
  };
2100
2126
  /**
2101
- * Options for the bearing directional indicator.
2127
+ * Options for the heading directional indicator.
2102
2128
  */
2103
- bearing?: {
2129
+ heading?: {
2104
2130
  /**
2105
- * The color of the bearing cone.
2131
+ * The color of the heading cone.
2106
2132
  * @default #2266ff
2107
2133
  */
2108
2134
  color?: string;
2109
2135
  /**
2110
- * The opacity of the bearing cone.
2136
+ * The opacity of the heading cone.
2111
2137
  * @default 0.7
2112
2138
  */
2113
2139
  opacity?: number;
@@ -2118,12 +2144,50 @@ declare module '@mappedin/mappedin-js/mappedin-js/src/types' {
2118
2144
  * @default 30000
2119
2145
  */
2120
2146
  timeout?: number;
2147
+ /**
2148
+ * Whether to watch the browser's position.
2149
+ * @default true
2150
+ */
2151
+ watchBrowserPosition?: boolean;
2121
2152
  /**
2122
2153
  * Whether to log debug messages.
2123
2154
  * @default false
2124
2155
  */
2125
2156
  debug?: boolean;
2126
2157
  };
2158
+ /**
2159
+ * Position update options for the {@link BlueDot.update} method.
2160
+ */
2161
+ export type TBlueDotPositionUpdate = {
2162
+ /**
2163
+ * Latitude to override.
2164
+ * Set to `'device'` to reset to the device's latitude.
2165
+ */
2166
+ latitude?: GeolocationPosition['coords']['latitude'] | 'device' | undefined;
2167
+ /**
2168
+ * Longitude to override.
2169
+ * Set to `'device'` to reset to the device's longitude.
2170
+ */
2171
+ longitude?: GeolocationPosition['coords']['longitude'] | 'device' | undefined;
2172
+ /**
2173
+ * Accuracy to override.
2174
+ * Set to `'device'` to reset to the device's accuracy.
2175
+ * Set to `undefined` to disable the accuracy ring.
2176
+ */
2177
+ accuracy?: GeolocationPosition['coords']['accuracy'] | 'device' | undefined;
2178
+ /**
2179
+ * Heading to override.
2180
+ * Set to `'device'` to reset to the device's heading.
2181
+ * Set to `undefined` to disable the heading indicator.
2182
+ */
2183
+ heading?: GeolocationPosition['coords']['heading'] | 'device' | undefined;
2184
+ /**
2185
+ * Floor level to override.
2186
+ * Set to `'device'` to reset to the device's floor level.
2187
+ * Set to `undefined` to disable floor level and show the BlueDot on all floors.
2188
+ */
2189
+ floor?: Floor | 'device' | undefined;
2190
+ };
2127
2191
  export type LanguagePackHydrationItem = {
2128
2192
  language: Language;
2129
2193
  localePack: ParsedMVFLocalePack;
@@ -2141,8 +2205,10 @@ declare module '@mappedin/mappedin-js/mappedin-js/src/map-view-objects' {
2141
2205
  }
2142
2206
 
2143
2207
  declare module '@mappedin/mappedin-js/mappedin-js/src/navigation' {
2208
+ import { type TDirectionInstruction } from '@mappedin/mappedin-js/mappedin-js/src';
2144
2209
  import type { Directions } from '@mappedin/mappedin-js/mappedin-js/src/api-geojson';
2145
2210
  import type { GeojsonApiMapObject } from '@mappedin/mappedin-js/mappedin-js/src/api-geojson/map-object';
2211
+ import { Path, Marker } from '@mappedin/mappedin-js/mappedin-js/src/map-view-objects';
2146
2212
  import type { RendererCore } from '@mappedin/core-sdk';
2147
2213
  /**
2148
2214
  * Options for navigation.
@@ -2177,6 +2243,12 @@ declare module '@mappedin/mappedin-js/mappedin-js/src/navigation' {
2177
2243
  * @default '#40A9FF'
2178
2244
  */
2179
2245
  color?: string;
2246
+ /**
2247
+ * Whether the path should be clickable.
2248
+ *
2249
+ * @defaultValue false
2250
+ */
2251
+ interactive?: boolean;
2180
2252
  /**
2181
2253
  * The accent color of the path. This is applied to arrows if they are displayed
2182
2254
  * @default 'blue'
@@ -2233,6 +2305,20 @@ declare module '@mappedin/mappedin-js/mappedin-js/src/navigation' {
2233
2305
  * @internal
2234
2306
  */
2235
2307
  constructor(core: RendererCore, currentMapGetter: CurrentMapGetter);
2308
+ /**
2309
+ * @internal
2310
+ */
2311
+ getPathById(id: string): {
2312
+ path: Path;
2313
+ entityIds: string[];
2314
+ } | undefined;
2315
+ /**
2316
+ * @internal
2317
+ */
2318
+ getMarkerById(id: string): {
2319
+ instruction: TDirectionInstruction;
2320
+ marker: Marker;
2321
+ } | undefined;
2236
2322
  /**
2237
2323
  * Draws the specified directions on the map.
2238
2324
  * @param directions The directions to be drawn.
@@ -3067,7 +3153,7 @@ declare module '@mappedin/mappedin-js/mappedin-js/src/map-data-objects/floor' {
3067
3153
  }
3068
3154
 
3069
3155
  declare module '@mappedin/mappedin-js/mappedin-js/src/map-data-objects/connection' {
3070
- import type { FeatureCollection, Image, Point, SpaceProperties } from '@mappedin/mvf';
3156
+ import type { Feature, FeatureCollection, Image, Point, SpaceProperties, Connection as MVFConnection } from '@mappedin/mvf';
3071
3157
  import Coordinate from '@mappedin/mappedin-js/mappedin-js/src/map-data-objects/coordinate';
3072
3158
  import type { Floor, MapDataInternal } from '@mappedin/mappedin-js/mappedin-js/src/map-data-objects';
3073
3159
  import BaseMapData from '@mappedin/mappedin-js/mappedin-js/src/map-data-objects/base-object';
@@ -3097,7 +3183,8 @@ declare module '@mappedin/mappedin-js/mappedin-js/src/map-data-objects/connectio
3097
3183
  * @internal
3098
3184
  */
3099
3185
  constructor(data: MapDataInternal, options: {
3100
- mvfDataByFloorId: Record<string, FeatureCollection<Point, SpaceProperties>['features'][number]>;
3186
+ mvfDataByFloorId: Record<string, FeatureCollection<Point, SpaceProperties>['features'][number]> | Record<string, Feature<Point, MVFConnection>>;
3187
+ accessible?: boolean;
3101
3188
  });
3102
3189
  /**
3103
3190
  * Gets the name of the connection.
@@ -3107,6 +3194,7 @@ declare module '@mappedin/mappedin-js/mappedin-js/src/map-data-objects/connectio
3107
3194
  get name(): string;
3108
3195
  get description(): string;
3109
3196
  get images(): Image[];
3197
+ get accessible(): boolean;
3110
3198
  /**
3111
3199
  * Gets the external ID of the connection.
3112
3200
  *
@@ -4162,7 +4250,7 @@ declare module '@mappedin/mappedin-js/mappedin-js/src' {
4162
4250
  export { parseMVF, unzipMVF, enableTestMode };
4163
4251
  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, };
4164
4252
  export type * from 'geojson';
4165
- 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, TBlueDotOptions, } from '@mappedin/mappedin-js/mappedin-js/src/types';
4253
+ 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, TBlueDotOptions, TBlueDotPositionUpdate, } from '@mappedin/mappedin-js/mappedin-js/src/types';
4166
4254
  export { WALLS, DOORS } from '@mappedin/mappedin-js/mappedin-js/src/types';
4167
4255
  export type { Label, Marker, Path, Shape, CameraTransform, Model } from '@mappedin/mappedin-js/mappedin-js/src/map-view-objects';
4168
4256
  export type { Navigation, TNavigationOptions } from '@mappedin/mappedin-js/mappedin-js/src/navigation';
@@ -4177,66 +4265,82 @@ declare module '@mappedin/mappedin-js/mappedin-js/src/api-geojson/blue-dot/blue-
4177
4265
  import type { RendererCore } from '@mappedin/core-sdk';
4178
4266
  import { PubSub } from '@packages/internal/common';
4179
4267
  import type { GeoJsonApi } from '@mappedin/mappedin-js/mappedin-js/src/api-geojson/api';
4180
- import type { TBlueDotOptions } from '@mappedin/mappedin-js/mappedin-js/src/types';
4181
- import { z } from 'zod';
4268
+ import type { TBlueDotOptions, TBlueDotPositionUpdate } from '@mappedin/mappedin-js/mappedin-js/src/types';
4269
+ import { Coordinate, type Floor } from '@mappedin/mappedin-js/mappedin-js/src/map-data-objects';
4182
4270
  export type TBlueDotEvents = {
4183
- 'floor-change': {
4184
- reason: 'blue-dot-floor-change';
4185
- floorId: string;
4186
- };
4271
+ 'floor-change': {
4272
+ reason: 'blue-dot-floor-change';
4273
+ floorId: string;
4274
+ };
4187
4275
  };
4188
4276
  export type TBlueDotState = 'hidden' | 'active' | 'inactive' | 'disabled';
4189
4277
  export type TBlueDotAction = 'timeout' | 'error' | 'position-received' | 'enable' | 'disable';
4190
4278
  export class BlueDot extends PubSub<TBlueDotEvents> {
4191
- #private;
4192
- /**
4193
- * @internal
4194
- */
4195
- constructor(core: RendererCore, geoJSONApi: GeoJsonApi);
4196
- enable(options?: TBlueDotOptions): void;
4197
- disable(): void;
4279
+ #private;
4280
+ state: TBlueDotState;
4281
+ /**
4282
+ * The direction the user is facing in degrees from north.
4283
+ */
4284
+ get heading(): GeolocationPosition['coords']['heading'] | undefined;
4285
+ /**
4286
+ * The accuracy of the current position in metres.
4287
+ */
4288
+ get accuracy(): GeolocationPosition['coords']['accuracy'] | undefined;
4289
+ /**
4290
+ * The coordinate of the current position.
4291
+ */
4292
+ get coordinate(): Coordinate | undefined;
4293
+ /**
4294
+ * The floor the Blue Dot is currently on. If undefined, the Blue Dot will appear on every floor.
4295
+ */
4296
+ get floor(): Floor | undefined;
4297
+ /**
4298
+ * @internal
4299
+ */
4300
+ constructor(core: RendererCore, geoJSONApi: GeoJsonApi);
4301
+ /**
4302
+ * Enable the Blue Dot. It will be hidden until a position is received either from the browser or by calling {@link BlueDot.update}.
4303
+ * @param options - The options to setup the Blue Dot.
4304
+ */
4305
+ enable(options?: TBlueDotOptions): void;
4306
+ /**
4307
+ * Disable the Blue Dot. It will be hidden and no longer update.
4308
+ */
4309
+ disable(): void;
4310
+ /**
4311
+ * Enable or disable the devices's geolocation listener to automatically position the Blue Dot.
4312
+ * If enabled, the device will request permission to access the user's precise location.
4313
+ * @param watch - Whether to enable or disable the listener.
4314
+ */
4315
+ watchDevicePosition(watch: boolean): void;
4316
+ /**
4317
+ * Manually override some position properties of the Blue Dot.
4318
+ * Accepts a full GeolocationPosition object or a partial {@link TBlueDotPositionUpdate} object.
4319
+ * @example Manually set the accuracy and heading
4320
+ * ```ts
4321
+ * api.BlueDot.update({ accuracy: 10, heading: 90 });
4322
+ * ```
4323
+ * @example Reset accuracy and heading to device values
4324
+ * ```ts
4325
+ * api.BlueDot.update({ accuracy: 'device', heading: 'device' });
4326
+ * ```
4327
+ */
4328
+ update(position: GeolocationPositionExtended | TBlueDotPositionUpdate | undefined): void;
4198
4329
  }
4199
4330
  type TStateTransitions = {
4200
- [Action in TBlueDotAction]?: TBlueDotState;
4331
+ [Action in TBlueDotAction]?: TBlueDotState;
4201
4332
  };
4202
4333
  type TStateMachine = {
4203
- [State in TBlueDotState]: {
4204
- actions: TStateTransitions;
4205
- };
4334
+ [State in TBlueDotState]: {
4335
+ actions: TStateTransitions;
4336
+ };
4206
4337
  };
4207
4338
  export const stateMachine: TStateMachine;
4208
- export const positionSchema: z.ZodObject<{
4209
- coords: z.ZodObject<{
4210
- latitude: z.ZodNumber;
4211
- longitude: z.ZodNumber;
4212
- floorLevel: z.ZodNullable<z.ZodOptional<z.ZodNumber>>;
4213
- accuracy: z.ZodNullable<z.ZodOptional<z.ZodNumber>>;
4214
- }, "strip", z.ZodTypeAny, {
4215
- latitude: number;
4216
- longitude: number;
4217
- floorLevel?: number | null | undefined;
4218
- accuracy?: number | null | undefined;
4219
- }, {
4220
- latitude: number;
4221
- longitude: number;
4222
- floorLevel?: number | null | undefined;
4223
- accuracy?: number | null | undefined;
4224
- }>;
4225
- }, "strip", z.ZodTypeAny, {
4226
- coords: {
4227
- latitude: number;
4228
- longitude: number;
4229
- floorLevel?: number | null | undefined;
4230
- accuracy?: number | null | undefined;
4231
- };
4232
- }, {
4233
- coords: {
4234
- latitude: number;
4235
- longitude: number;
4236
- floorLevel?: number | null | undefined;
4237
- accuracy?: number | null | undefined;
4238
- };
4239
- }>;
4339
+ export type GeolocationPositionExtended = GeolocationPosition & {
4340
+ coords: GeolocationPosition['coords'] & {
4341
+ readonly floorLevel?: number;
4342
+ };
4343
+ };
4240
4344
  export {};
4241
4345
  }
4242
4346
 
@@ -4450,9 +4554,9 @@ declare module '@mappedin/mappedin-js/geojson/src/components/marker' {
4450
4554
 
4451
4555
  declare module '@mappedin/mappedin-js/geojson/src/components/path' {
4452
4556
  import { Vector3 } from 'three';
4453
- import type { Mesh, ShaderMaterial, BufferGeometry } from 'three';
4557
+ import type { Mesh, BufferGeometry } from 'three';
4454
4558
  import type { EntityId, Position } from '@mappedin/mappedin-js/geojson/src/types';
4455
- import { Geometry3DObject3D } from '@mappedin/mappedin-js/geojson/src/entities/geometry3d';
4559
+ import type { PathMaterial, PatMeshContainer } from '@mappedin/mappedin-js/geojson/src/entities/geometry3d';
4456
4560
  import type { FeatureCollection, Point } from 'geojson';
4457
4561
  import type { GroupContainerState } from '@mappedin/mappedin-js/geojson/src/entities/group-container';
4458
4562
  export type PathProperties = {
@@ -4461,6 +4565,11 @@ declare module '@mappedin/mappedin-js/geojson/src/components/path' {
4461
4565
  */
4462
4566
  parentId?: EntityId<GroupContainerState> | string | null;
4463
4567
  };
4568
+ /**
4569
+ * Updatable path state
4570
+ * @interface
4571
+ */
4572
+ export type PathUpdateState = Omit<Partial<PathState>, 'id' | 'type'>;
4464
4573
  /**
4465
4574
  * State representing a Path
4466
4575
  */
@@ -4489,6 +4598,30 @@ declare module '@mappedin/mappedin-js/geojson/src/components/path' {
4489
4598
  * Note: use values between 0 and 1.
4490
4599
  */
4491
4600
  completeFraction: number;
4601
+ /**
4602
+ * The color of the path.
4603
+ */
4604
+ color: string;
4605
+ /**
4606
+ * The accent color of the path. When arrows are visible, it is applied to them
4607
+ */
4608
+ accentColor: string;
4609
+ /**
4610
+ * Display Arrows on Path to indicate direction
4611
+ */
4612
+ displayArrowsOnPath: boolean;
4613
+ /**
4614
+ * Arrows on path should animate to indicate direction
4615
+ */
4616
+ animateArrowsOnPath: boolean;
4617
+ /**
4618
+ * The radius of the path when zoomed in
4619
+ */
4620
+ nearRadius: number;
4621
+ /**
4622
+ * The radius of the path when zoomed out
4623
+ */
4624
+ farRadius: number;
4492
4625
  };
4493
4626
  export type AddPathOptions = {
4494
4627
  /**
@@ -4528,16 +4661,16 @@ declare module '@mappedin/mappedin-js/geojson/src/components/path' {
4528
4661
  export class PathComponent {
4529
4662
  #private;
4530
4663
  readonly type = "path";
4531
- mesh: Geometry3DObject3D;
4532
- material?: ShaderMaterial;
4664
+ mesh: PatMeshContainer;
4665
+ material?: PathMaterial;
4533
4666
  geometry?: BufferGeometry;
4534
4667
  outline?: Mesh;
4535
4668
  feature: FeatureCollection<Point, PathProperties>;
4536
4669
  options: AddPathOptions;
4537
4670
  nearRadius: number;
4538
4671
  farRadius: number;
4539
- color: string;
4540
4672
  accentColor: string;
4673
+ completeFraction: number;
4541
4674
  altitudeAdjustment: number;
4542
4675
  displayArrowsOnPath: boolean;
4543
4676
  animateArrowsOnPath: boolean;
@@ -4546,11 +4679,10 @@ declare module '@mappedin/mappedin-js/geojson/src/components/path' {
4546
4679
  */
4547
4680
  isVertical: boolean;
4548
4681
  dirty: boolean;
4682
+ materialDirty: boolean;
4549
4683
  constructor(feature: FeatureCollection<Point, PathProperties>, options?: AddPathOptions);
4550
4684
  setColor(): void;
4551
4685
  setOpacity(): void;
4552
- set completeFraction(value: number);
4553
- get completeFraction(): number;
4554
4686
  set visible(visible: boolean);
4555
4687
  get visible(): boolean;
4556
4688
  position: Vector3;
@@ -5366,6 +5498,10 @@ declare module '@mappedin/mappedin-js/geojson/src/types' {
5366
5498
  * The coordinate of the interaction.
5367
5499
  */
5368
5500
  coordinate: Position;
5501
+ /**
5502
+ * An array of path IDs which the user interaction passed through. Will be empty if no paths were interacted with.
5503
+ */
5504
+ paths: (string | number)[] | [];
5369
5505
  /**
5370
5506
  * An array of marker IDs which the user interaction passed through. Will be empty if no markers were interacted with.
5371
5507
  */
@@ -5946,7 +6082,7 @@ declare module '@mappedin/mappedin-js/geojson/src/renderer' {
5946
6082
  import { TwoDVisibilitySystem } from '@mappedin/mappedin-js/geojson/src/systems/2d-visibility/system';
5947
6083
  import { RenderSystem } from '@mappedin/mappedin-js/geojson/src/systems/render/system';
5948
6084
  import type { Position as GeoJsonPosition, FeatureCollection, LineString, MultiPolygon, Polygon, Point, Feature } from 'geojson';
5949
- import type { AddPathOptions, PathProperties, PathState } from '@mappedin/mappedin-js/geojson/src/components/path';
6085
+ import type { AddPathOptions, PathProperties, PathState, PathUpdateState } from '@mappedin/mappedin-js/geojson/src/components/path';
5950
6086
  import { StackSystem } from '@mappedin/mappedin-js/geojson/src/systems/stack/system';
5951
6087
  import { CameraSystem } from '@mappedin/mappedin-js/geojson/src/systems/camera';
5952
6088
  import { DOMDrawSystem } from '@mappedin/mappedin-js/geojson/src/systems/dom-draw/system';
@@ -6121,7 +6257,7 @@ declare module '@mappedin/mappedin-js/geojson/src/renderer' {
6121
6257
  * Get the current state of the map view, or any entity that was added, regardless of whether it is visible in the scene
6122
6258
  */
6123
6259
  getState(): MapViewState;
6124
- 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 : T extends EntityId<ImageState> ? ImageState : EntityState;
6260
+ 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> ? PathState : T extends EntityId<ShapeState> ? ShapeState : T extends EntityId<ImageState> ? ImageState : EntityState;
6125
6261
  getState(geometryOrGeometryId?: Record<string | number, any> | string | number): EntityState;
6126
6262
  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 ? PathState : T extends ShapeState ? ShapeState : T extends ImageState ? ImageState : EntityState;
6127
6263
  /**
@@ -6134,7 +6270,7 @@ declare module '@mappedin/mappedin-js/geojson/src/renderer' {
6134
6270
  setState<T extends EntityId<GroupContainerState>>(object: T | T['id'], state: Partial<GroupContainerState>): void;
6135
6271
  setState<T extends EntityId<GeometryState>>(object: T | T['id'], state: Partial<GeometryState>): void;
6136
6272
  setState<T extends EntityId<ShapeState>>(object: T | T['id'], state: Partial<ShapeState>): void;
6137
- setState<T extends EntityId<PathState>>(object: T | T['id'], state: Partial<PathState>): void;
6273
+ setState<T extends EntityId<PathState>>(object: T | T['id'], state: PathUpdateState): void;
6138
6274
  setState<T extends EntityId<ModelState>>(object: T | T['id'], state: Partial<ModelState>): void;
6139
6275
  setState<T extends EntityId<ImageState>>(object: T | T['id'], state: Partial<ImageState>): void;
6140
6276
  setState<T extends EntityState>(object: T | T['id'], state: Partial<T>): void;
@@ -6552,7 +6688,7 @@ declare module '@mappedin/mappedin-js/geojson/src/utils' {
6552
6688
  export { getPixelRatio } from '@mappedin/mappedin-js/geojson/src/utils/get-pixel-ratio';
6553
6689
  export { debounce } from '@mappedin/mappedin-js/geojson/src/utils/async';
6554
6690
  export { shouldDisableOffscreenCanvas } from '@mappedin/mappedin-js/geojson/src/utils/browser';
6555
- export { noop } from '@mappedin/mappedin-js/geojson/src/utils/fp';
6691
+ export { noop, pick, isEmpty, type KeysOfUnion } from '@mappedin/mappedin-js/geojson/src/utils/fp';
6556
6692
  export { transformRequest } from '@mappedin/mappedin-js/geojson/src/utils/tranform-request';
6557
6693
  }
6558
6694
 
@@ -6979,7 +7115,10 @@ declare module '@mappedin/mappedin-js/mappedin-js/src/api-geojson/map-object' {
6979
7115
  floorId: string;
6980
7116
  };
6981
7117
  }> {
7118
+ /** Floors sorted in order of elevation */
6982
7119
  floors: FloorObject[];
7120
+ /** Map of floors by elevation. Floor elevation does not always match index or is not always contiguous. */
7121
+ floorsByElevation: Map<number, FloorObject>;
6983
7122
  currentFloorId: string;
6984
7123
  id: string;
6985
7124
  renderer: RendererCore;
@@ -8099,7 +8238,7 @@ declare module '@mappedin/mappedin-js/mappedin-js/src/analytics/customer' {
8099
8238
  latitude: number;
8100
8239
  longitude: number;
8101
8240
  floorLevel?: number;
8102
- accuracy: number;
8241
+ accuracy?: number;
8103
8242
  };
8104
8243
  type AnalyticsAuth = {
8105
8244
  /** The API key for authentication. */
@@ -8176,6 +8315,7 @@ declare module '@mappedin/mappedin-js/mappedin-js/src/map-data-objects/base-meta
8176
8315
 
8177
8316
  declare module '@mappedin/mappedin-js/geojson/src/entities/geometry3d' {
8178
8317
  import { Object3D } from 'three';
8318
+ import type { Mesh, Object3DEventMap, ShaderMaterial, Texture, TubeGeometry, Color, Vector2 } from 'three';
8179
8319
  import type { InteractionComponent } from '@mappedin/mappedin-js/geojson/src/components/interaction';
8180
8320
  import type { MeshComponent } from '@mappedin/mappedin-js/geojson/src/components/mesh';
8181
8321
  import type { ModelComponent } from '@mappedin/mappedin-js/geojson/src/components/model';
@@ -8196,15 +8336,104 @@ declare module '@mappedin/mappedin-js/geojson/src/entities/geometry3d' {
8196
8336
  type: 'geometry' | 'path' | 'model' | 'custom-geometry' | 'image';
8197
8337
  };
8198
8338
  }
8339
+ export type PathMaterial = ShaderMaterial & {
8340
+ uniforms: PathUniforms;
8341
+ };
8342
+ export type PathMesh = Mesh<TubeGeometry, PathMaterial, Object3DEventMap>;
8343
+ export class PatMeshContainer extends Geometry3DObject3D {
8344
+ children: [PathMesh, PathMesh];
8345
+ }
8199
8346
  export type MeshComponentTypes = MeshComponent | PathComponent | ModelComponent | CustomGeometryComponent | ImageComponent;
8200
8347
  export class Geometry3D {
8201
8348
  id: string | number;
8202
8349
  components: [MeshComponentTypes, StyleComponent, InteractionComponent?];
8203
- get object3d(): Geometry3DObject3D | import("../components/mesh").EntityBatchedMesh | undefined;
8350
+ get object3d(): Geometry3DObject3D | PatMeshContainer | import("../components/mesh").EntityBatchedMesh | undefined;
8204
8351
  get parent(): GroupContainerObject3D | GeometryGroupObject3D | null;
8205
8352
  get type(): 'geometry' | 'path' | 'model' | 'custom-geometry' | 'image';
8206
8353
  constructor(meshComponent: MeshComponent | PathComponent | ModelComponent | CustomGeometryComponent | ImageComponent, styleComponent: StyleComponent);
8207
8354
  }
8355
+ export interface PathUniforms {
8356
+ vertexes: {
8357
+ type: 'f';
8358
+ value: number;
8359
+ };
8360
+ resolution: {
8361
+ type: 'v2';
8362
+ value: Vector2;
8363
+ };
8364
+ cameraParameters: {
8365
+ type: 'v2';
8366
+ value: Vector2;
8367
+ };
8368
+ complete: {
8369
+ type: 'f';
8370
+ value: number;
8371
+ };
8372
+ color: {
8373
+ type: 'c';
8374
+ value: Color;
8375
+ };
8376
+ pathLength: {
8377
+ type: 'f';
8378
+ value: number;
8379
+ };
8380
+ nearRadius: {
8381
+ type: 'f';
8382
+ value: number;
8383
+ };
8384
+ farRadius: {
8385
+ type: 'f';
8386
+ value: number;
8387
+ };
8388
+ nearZoom: {
8389
+ type: 'f';
8390
+ value: number;
8391
+ };
8392
+ farZoom: {
8393
+ type: 'f';
8394
+ value: number;
8395
+ };
8396
+ pulseColor: {
8397
+ type: 'c';
8398
+ value: Color;
8399
+ };
8400
+ pulse: {
8401
+ type: 'f';
8402
+ value: number;
8403
+ };
8404
+ pulseLength: {
8405
+ type: 'f';
8406
+ value: number;
8407
+ };
8408
+ pathIsVertical: {
8409
+ type: 'b';
8410
+ value: boolean;
8411
+ };
8412
+ arrowAnimationTimer: {
8413
+ type: 'f';
8414
+ value: number;
8415
+ };
8416
+ arrowTexture: {
8417
+ type: 't';
8418
+ value: Texture;
8419
+ };
8420
+ displayArrowsOnPath: {
8421
+ type: 'b';
8422
+ value: boolean;
8423
+ };
8424
+ flattenFactor: {
8425
+ type: 'f';
8426
+ value: number;
8427
+ };
8428
+ showPulse: {
8429
+ type: 'b';
8430
+ value: boolean;
8431
+ };
8432
+ opacityMultiplier: {
8433
+ type: 'f';
8434
+ value: number;
8435
+ };
8436
+ }
8208
8437
  }
8209
8438
 
8210
8439
  declare module '@mappedin/mappedin-js/geojson/src/entities/geometry2d' {
@@ -8416,7 +8645,7 @@ declare module '@mappedin/mappedin-js/geojson/src/components/image' {
8416
8645
  declare module '@mappedin/mappedin-js/geojson/src/entities' {
8417
8646
  export { updateInteractivity } from '@mappedin/mappedin-js/geojson/src/entities/utils';
8418
8647
  export { Geometry2D, Geometry2DComponents } from '@mappedin/mappedin-js/geojson/src/entities/geometry2d';
8419
- export { Geometry3D, Geometry3DComponents } from '@mappedin/mappedin-js/geojson/src/entities/geometry3d';
8648
+ export { Geometry3D, Geometry3DComponents, type PathMesh, type PatMeshContainer, type PathMaterial, } from '@mappedin/mappedin-js/geojson/src/entities/geometry3d';
8420
8649
  }
8421
8650
 
8422
8651
  declare module '@mappedin/mappedin-js/geojson/src/types/options' {
@@ -9222,6 +9451,23 @@ declare module '@mappedin/mappedin-js/geojson/src/utils/browser' {
9222
9451
 
9223
9452
  declare module '@mappedin/mappedin-js/geojson/src/utils/fp' {
9224
9453
  export function noop(): void;
9454
+ export type KeysOfUnion<T> = T extends T ? keyof T : never;
9455
+ /**
9456
+ * Given an object and a number of properties as strings, return version
9457
+ * of that object with only those properties.
9458
+ *
9459
+ * @param src - the object
9460
+ * @param properties - an array of property names chosen
9461
+ * to appear on the resulting object.
9462
+ * @returns object with limited properties.
9463
+ * @example
9464
+ * ```ts
9465
+ * let foo = { name: 'Charlie', age: 10 };
9466
+ * let justName = pick(foo, ['name']); // justName = { name: 'Charlie' }
9467
+ * ```
9468
+ */
9469
+ export function pick<T extends object>(src: T, properties: KeysOfUnion<T>[]): Partial<T>;
9470
+ export function isEmpty(obj: Record<string, any>): boolean;
9225
9471
  }
9226
9472
 
9227
9473
  declare module '@mappedin/mappedin-js/geojson/src/utils/tranform-request' {
@@ -9367,8 +9613,9 @@ declare module '@mappedin/mappedin-js/geojson/src/components/style' {
9367
9613
  }
9368
9614
 
9369
9615
  declare module '@mappedin/mappedin-js/geojson/src/entities/utils' {
9370
- import type { CollisionRankingTier, GeometryState, LabelState, PathState, RendererCore } from '@mappedin/mappedin-js/geojson/src';
9616
+ import type { CollisionRankingTier, GeometryState, LabelState, RendererCore } from '@mappedin/mappedin-js/geojson/src';
9371
9617
  import { type MarkerState } from '@mappedin/mappedin-js/geojson/src/components/marker';
9618
+ import type { PathUpdateState } from '@mappedin/mappedin-js/geojson/src/components/path';
9372
9619
  import type { Geometry3DTypes, Position, RendererState } from '@mappedin/mappedin-js/geojson/src/renderer';
9373
9620
  import { GeometryGroupObject3D, type GeometryGroupState } from '@mappedin/mappedin-js/geojson/src/entities/geometry-group';
9374
9621
  import { GroupContainerObject3D } from '@mappedin/mappedin-js/geojson/src/entities/group-container';
@@ -9385,7 +9632,6 @@ declare module '@mappedin/mappedin-js/geojson/src/entities/utils' {
9385
9632
  export function updatePosition(entity: Geometry3D | Geometry2D | GeometryGroupObject3D | GroupContainerObject3D, update: Position | undefined, convertTo3DMapPosition: RendererCore['convertTo3DMapPosition']): void;
9386
9633
  export function updateParent(entity: Geometry3D | Geometry2D | GeometryGroupObject3D | GroupContainerObject3D, update: GroupContainerObject3D | undefined): boolean;
9387
9634
  export function updateEnabled(entity: Geometry3D | Geometry2D | GeometryGroupObject3D | GroupContainerObject3D, update: boolean | undefined): void;
9388
- export function updatePath(entity: Geometry3D | Geometry2D | GeometryGroupObject3D | GroupContainerObject3D, update: Partial<PathState> | undefined): void;
9389
9635
  export function updateMarker(entity: Geometry3D | Geometry2D | GeometryGroupObject3D | GroupContainerObject3D, update: Partial<MarkerState> | undefined, state: RendererState): boolean;
9390
9636
  export function updateRank(entity: Geometry3D | Geometry2D | GeometryGroupObject3D | GroupContainerObject3D, update: CollisionRankingTier | undefined): boolean;
9391
9637
  export function updateLabel(entity: Geometry3D | Geometry2D | GeometryGroupObject3D | GroupContainerObject3D, update: Partial<LabelState> | undefined, state: RendererState): void;
@@ -9398,6 +9644,8 @@ declare module '@mappedin/mappedin-js/geojson/src/entities/utils' {
9398
9644
  export function updateIndividualGeometryOpacity(entity: Geometry3D, update?: number): boolean;
9399
9645
  export function updateAltitude(entity: Geometry3D | Geometry2D | GeometryGroupObject3D | GroupContainerObject3D, update?: number): boolean;
9400
9646
  export function updateOutline(entity: Geometry3DTypes, update?: boolean): boolean;
9647
+ export function handlePathUpdate(geometry: Geometry3D, update: PathUpdateState): void;
9648
+ export function pickPathOptions(update: PathUpdateState): Partial<PathUpdateState>;
9401
9649
  }
9402
9650
 
9403
9651
  declare module '@mappedin/mappedin-js/geojson/src/systems/collisions/collider-processor' {