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

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,81 @@ 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: (GeolocationPosition & {
4329
+ coords: GeolocationPosition['coords'] & {
4330
+ readonly floorLevel?: number;
4331
+ };
4332
+ }) | TBlueDotPositionUpdate | undefined): void;
4198
4333
  }
4199
4334
  type TStateTransitions = {
4200
- [Action in TBlueDotAction]?: TBlueDotState;
4335
+ [Action in TBlueDotAction]?: TBlueDotState;
4201
4336
  };
4202
4337
  type TStateMachine = {
4203
- [State in TBlueDotState]: {
4204
- actions: TStateTransitions;
4205
- };
4338
+ [State in TBlueDotState]: {
4339
+ actions: TStateTransitions;
4340
+ };
4206
4341
  };
4207
4342
  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
- }>;
4240
4343
  export {};
4241
4344
  }
4242
4345
 
@@ -4450,9 +4553,9 @@ declare module '@mappedin/mappedin-js/geojson/src/components/marker' {
4450
4553
 
4451
4554
  declare module '@mappedin/mappedin-js/geojson/src/components/path' {
4452
4555
  import { Vector3 } from 'three';
4453
- import type { Mesh, ShaderMaterial, BufferGeometry } from 'three';
4556
+ import type { Mesh, BufferGeometry } from 'three';
4454
4557
  import type { EntityId, Position } from '@mappedin/mappedin-js/geojson/src/types';
4455
- import { Geometry3DObject3D } from '@mappedin/mappedin-js/geojson/src/entities/geometry3d';
4558
+ import type { PathMaterial, PatMeshContainer } from '@mappedin/mappedin-js/geojson/src/entities/geometry3d';
4456
4559
  import type { FeatureCollection, Point } from 'geojson';
4457
4560
  import type { GroupContainerState } from '@mappedin/mappedin-js/geojson/src/entities/group-container';
4458
4561
  export type PathProperties = {
@@ -4461,6 +4564,11 @@ declare module '@mappedin/mappedin-js/geojson/src/components/path' {
4461
4564
  */
4462
4565
  parentId?: EntityId<GroupContainerState> | string | null;
4463
4566
  };
4567
+ /**
4568
+ * Updatable path state
4569
+ * @interface
4570
+ */
4571
+ export type PathUpdateState = Omit<Partial<PathState>, 'id' | 'type'>;
4464
4572
  /**
4465
4573
  * State representing a Path
4466
4574
  */
@@ -4489,6 +4597,30 @@ declare module '@mappedin/mappedin-js/geojson/src/components/path' {
4489
4597
  * Note: use values between 0 and 1.
4490
4598
  */
4491
4599
  completeFraction: number;
4600
+ /**
4601
+ * The color of the path.
4602
+ */
4603
+ color: string;
4604
+ /**
4605
+ * The accent color of the path. When arrows are visible, it is applied to them
4606
+ */
4607
+ accentColor: string;
4608
+ /**
4609
+ * Display Arrows on Path to indicate direction
4610
+ */
4611
+ displayArrowsOnPath: boolean;
4612
+ /**
4613
+ * Arrows on path should animate to indicate direction
4614
+ */
4615
+ animateArrowsOnPath: boolean;
4616
+ /**
4617
+ * The radius of the path when zoomed in
4618
+ */
4619
+ nearRadius: number;
4620
+ /**
4621
+ * The radius of the path when zoomed out
4622
+ */
4623
+ farRadius: number;
4492
4624
  };
4493
4625
  export type AddPathOptions = {
4494
4626
  /**
@@ -4528,16 +4660,16 @@ declare module '@mappedin/mappedin-js/geojson/src/components/path' {
4528
4660
  export class PathComponent {
4529
4661
  #private;
4530
4662
  readonly type = "path";
4531
- mesh: Geometry3DObject3D;
4532
- material?: ShaderMaterial;
4663
+ mesh: PatMeshContainer;
4664
+ material?: PathMaterial;
4533
4665
  geometry?: BufferGeometry;
4534
4666
  outline?: Mesh;
4535
4667
  feature: FeatureCollection<Point, PathProperties>;
4536
4668
  options: AddPathOptions;
4537
4669
  nearRadius: number;
4538
4670
  farRadius: number;
4539
- color: string;
4540
4671
  accentColor: string;
4672
+ completeFraction: number;
4541
4673
  altitudeAdjustment: number;
4542
4674
  displayArrowsOnPath: boolean;
4543
4675
  animateArrowsOnPath: boolean;
@@ -4546,11 +4678,10 @@ declare module '@mappedin/mappedin-js/geojson/src/components/path' {
4546
4678
  */
4547
4679
  isVertical: boolean;
4548
4680
  dirty: boolean;
4681
+ materialDirty: boolean;
4549
4682
  constructor(feature: FeatureCollection<Point, PathProperties>, options?: AddPathOptions);
4550
4683
  setColor(): void;
4551
4684
  setOpacity(): void;
4552
- set completeFraction(value: number);
4553
- get completeFraction(): number;
4554
4685
  set visible(visible: boolean);
4555
4686
  get visible(): boolean;
4556
4687
  position: Vector3;
@@ -5366,6 +5497,10 @@ declare module '@mappedin/mappedin-js/geojson/src/types' {
5366
5497
  * The coordinate of the interaction.
5367
5498
  */
5368
5499
  coordinate: Position;
5500
+ /**
5501
+ * An array of path IDs which the user interaction passed through. Will be empty if no paths were interacted with.
5502
+ */
5503
+ paths: (string | number)[] | [];
5369
5504
  /**
5370
5505
  * An array of marker IDs which the user interaction passed through. Will be empty if no markers were interacted with.
5371
5506
  */
@@ -5946,7 +6081,7 @@ declare module '@mappedin/mappedin-js/geojson/src/renderer' {
5946
6081
  import { TwoDVisibilitySystem } from '@mappedin/mappedin-js/geojson/src/systems/2d-visibility/system';
5947
6082
  import { RenderSystem } from '@mappedin/mappedin-js/geojson/src/systems/render/system';
5948
6083
  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';
6084
+ import type { AddPathOptions, PathProperties, PathState, PathUpdateState } from '@mappedin/mappedin-js/geojson/src/components/path';
5950
6085
  import { StackSystem } from '@mappedin/mappedin-js/geojson/src/systems/stack/system';
5951
6086
  import { CameraSystem } from '@mappedin/mappedin-js/geojson/src/systems/camera';
5952
6087
  import { DOMDrawSystem } from '@mappedin/mappedin-js/geojson/src/systems/dom-draw/system';
@@ -6121,7 +6256,7 @@ declare module '@mappedin/mappedin-js/geojson/src/renderer' {
6121
6256
  * Get the current state of the map view, or any entity that was added, regardless of whether it is visible in the scene
6122
6257
  */
6123
6258
  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;
6259
+ 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
6260
  getState(geometryOrGeometryId?: Record<string | number, any> | string | number): EntityState;
6126
6261
  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
6262
  /**
@@ -6134,7 +6269,7 @@ declare module '@mappedin/mappedin-js/geojson/src/renderer' {
6134
6269
  setState<T extends EntityId<GroupContainerState>>(object: T | T['id'], state: Partial<GroupContainerState>): void;
6135
6270
  setState<T extends EntityId<GeometryState>>(object: T | T['id'], state: Partial<GeometryState>): void;
6136
6271
  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;
6272
+ setState<T extends EntityId<PathState>>(object: T | T['id'], state: PathUpdateState): void;
6138
6273
  setState<T extends EntityId<ModelState>>(object: T | T['id'], state: Partial<ModelState>): void;
6139
6274
  setState<T extends EntityId<ImageState>>(object: T | T['id'], state: Partial<ImageState>): void;
6140
6275
  setState<T extends EntityState>(object: T | T['id'], state: Partial<T>): void;
@@ -6552,7 +6687,7 @@ declare module '@mappedin/mappedin-js/geojson/src/utils' {
6552
6687
  export { getPixelRatio } from '@mappedin/mappedin-js/geojson/src/utils/get-pixel-ratio';
6553
6688
  export { debounce } from '@mappedin/mappedin-js/geojson/src/utils/async';
6554
6689
  export { shouldDisableOffscreenCanvas } from '@mappedin/mappedin-js/geojson/src/utils/browser';
6555
- export { noop } from '@mappedin/mappedin-js/geojson/src/utils/fp';
6690
+ export { noop, pick, isEmpty, type KeysOfUnion } from '@mappedin/mappedin-js/geojson/src/utils/fp';
6556
6691
  export { transformRequest } from '@mappedin/mappedin-js/geojson/src/utils/tranform-request';
6557
6692
  }
6558
6693
 
@@ -6979,7 +7114,10 @@ declare module '@mappedin/mappedin-js/mappedin-js/src/api-geojson/map-object' {
6979
7114
  floorId: string;
6980
7115
  };
6981
7116
  }> {
7117
+ /** Floors sorted in order of elevation */
6982
7118
  floors: FloorObject[];
7119
+ /** Map of floors by elevation. Floor elevation does not always match index or is not always contiguous. */
7120
+ floorsByElevation: Map<number, FloorObject>;
6983
7121
  currentFloorId: string;
6984
7122
  id: string;
6985
7123
  renderer: RendererCore;
@@ -8099,7 +8237,7 @@ declare module '@mappedin/mappedin-js/mappedin-js/src/analytics/customer' {
8099
8237
  latitude: number;
8100
8238
  longitude: number;
8101
8239
  floorLevel?: number;
8102
- accuracy: number;
8240
+ accuracy?: number;
8103
8241
  };
8104
8242
  type AnalyticsAuth = {
8105
8243
  /** The API key for authentication. */
@@ -8176,6 +8314,7 @@ declare module '@mappedin/mappedin-js/mappedin-js/src/map-data-objects/base-meta
8176
8314
 
8177
8315
  declare module '@mappedin/mappedin-js/geojson/src/entities/geometry3d' {
8178
8316
  import { Object3D } from 'three';
8317
+ import type { Mesh, Object3DEventMap, ShaderMaterial, Texture, TubeGeometry, Color, Vector2 } from 'three';
8179
8318
  import type { InteractionComponent } from '@mappedin/mappedin-js/geojson/src/components/interaction';
8180
8319
  import type { MeshComponent } from '@mappedin/mappedin-js/geojson/src/components/mesh';
8181
8320
  import type { ModelComponent } from '@mappedin/mappedin-js/geojson/src/components/model';
@@ -8196,15 +8335,104 @@ declare module '@mappedin/mappedin-js/geojson/src/entities/geometry3d' {
8196
8335
  type: 'geometry' | 'path' | 'model' | 'custom-geometry' | 'image';
8197
8336
  };
8198
8337
  }
8338
+ export type PathMaterial = ShaderMaterial & {
8339
+ uniforms: PathUniforms;
8340
+ };
8341
+ export type PathMesh = Mesh<TubeGeometry, PathMaterial, Object3DEventMap>;
8342
+ export class PatMeshContainer extends Geometry3DObject3D {
8343
+ children: [PathMesh, PathMesh];
8344
+ }
8199
8345
  export type MeshComponentTypes = MeshComponent | PathComponent | ModelComponent | CustomGeometryComponent | ImageComponent;
8200
8346
  export class Geometry3D {
8201
8347
  id: string | number;
8202
8348
  components: [MeshComponentTypes, StyleComponent, InteractionComponent?];
8203
- get object3d(): Geometry3DObject3D | import("../components/mesh").EntityBatchedMesh | undefined;
8349
+ get object3d(): Geometry3DObject3D | PatMeshContainer | import("../components/mesh").EntityBatchedMesh | undefined;
8204
8350
  get parent(): GroupContainerObject3D | GeometryGroupObject3D | null;
8205
8351
  get type(): 'geometry' | 'path' | 'model' | 'custom-geometry' | 'image';
8206
8352
  constructor(meshComponent: MeshComponent | PathComponent | ModelComponent | CustomGeometryComponent | ImageComponent, styleComponent: StyleComponent);
8207
8353
  }
8354
+ export interface PathUniforms {
8355
+ vertexes: {
8356
+ type: 'f';
8357
+ value: number;
8358
+ };
8359
+ resolution: {
8360
+ type: 'v2';
8361
+ value: Vector2;
8362
+ };
8363
+ cameraParameters: {
8364
+ type: 'v2';
8365
+ value: Vector2;
8366
+ };
8367
+ complete: {
8368
+ type: 'f';
8369
+ value: number;
8370
+ };
8371
+ color: {
8372
+ type: 'c';
8373
+ value: Color;
8374
+ };
8375
+ pathLength: {
8376
+ type: 'f';
8377
+ value: number;
8378
+ };
8379
+ nearRadius: {
8380
+ type: 'f';
8381
+ value: number;
8382
+ };
8383
+ farRadius: {
8384
+ type: 'f';
8385
+ value: number;
8386
+ };
8387
+ nearZoom: {
8388
+ type: 'f';
8389
+ value: number;
8390
+ };
8391
+ farZoom: {
8392
+ type: 'f';
8393
+ value: number;
8394
+ };
8395
+ pulseColor: {
8396
+ type: 'c';
8397
+ value: Color;
8398
+ };
8399
+ pulse: {
8400
+ type: 'f';
8401
+ value: number;
8402
+ };
8403
+ pulseLength: {
8404
+ type: 'f';
8405
+ value: number;
8406
+ };
8407
+ pathIsVertical: {
8408
+ type: 'b';
8409
+ value: boolean;
8410
+ };
8411
+ arrowAnimationTimer: {
8412
+ type: 'f';
8413
+ value: number;
8414
+ };
8415
+ arrowTexture: {
8416
+ type: 't';
8417
+ value: Texture;
8418
+ };
8419
+ displayArrowsOnPath: {
8420
+ type: 'b';
8421
+ value: boolean;
8422
+ };
8423
+ flattenFactor: {
8424
+ type: 'f';
8425
+ value: number;
8426
+ };
8427
+ showPulse: {
8428
+ type: 'b';
8429
+ value: boolean;
8430
+ };
8431
+ opacityMultiplier: {
8432
+ type: 'f';
8433
+ value: number;
8434
+ };
8435
+ }
8208
8436
  }
8209
8437
 
8210
8438
  declare module '@mappedin/mappedin-js/geojson/src/entities/geometry2d' {
@@ -8416,7 +8644,7 @@ declare module '@mappedin/mappedin-js/geojson/src/components/image' {
8416
8644
  declare module '@mappedin/mappedin-js/geojson/src/entities' {
8417
8645
  export { updateInteractivity } from '@mappedin/mappedin-js/geojson/src/entities/utils';
8418
8646
  export { Geometry2D, Geometry2DComponents } from '@mappedin/mappedin-js/geojson/src/entities/geometry2d';
8419
- export { Geometry3D, Geometry3DComponents } from '@mappedin/mappedin-js/geojson/src/entities/geometry3d';
8647
+ export { Geometry3D, Geometry3DComponents, type PathMesh, type PatMeshContainer, type PathMaterial, } from '@mappedin/mappedin-js/geojson/src/entities/geometry3d';
8420
8648
  }
8421
8649
 
8422
8650
  declare module '@mappedin/mappedin-js/geojson/src/types/options' {
@@ -9222,6 +9450,23 @@ declare module '@mappedin/mappedin-js/geojson/src/utils/browser' {
9222
9450
 
9223
9451
  declare module '@mappedin/mappedin-js/geojson/src/utils/fp' {
9224
9452
  export function noop(): void;
9453
+ export type KeysOfUnion<T> = T extends T ? keyof T : never;
9454
+ /**
9455
+ * Given an object and a number of properties as strings, return version
9456
+ * of that object with only those properties.
9457
+ *
9458
+ * @param src - the object
9459
+ * @param properties - an array of property names chosen
9460
+ * to appear on the resulting object.
9461
+ * @returns object with limited properties.
9462
+ * @example
9463
+ * ```ts
9464
+ * let foo = { name: 'Charlie', age: 10 };
9465
+ * let justName = pick(foo, ['name']); // justName = { name: 'Charlie' }
9466
+ * ```
9467
+ */
9468
+ export function pick<T extends object>(src: T, properties: KeysOfUnion<T>[]): Partial<T>;
9469
+ export function isEmpty(obj: Record<string, any>): boolean;
9225
9470
  }
9226
9471
 
9227
9472
  declare module '@mappedin/mappedin-js/geojson/src/utils/tranform-request' {
@@ -9367,8 +9612,9 @@ declare module '@mappedin/mappedin-js/geojson/src/components/style' {
9367
9612
  }
9368
9613
 
9369
9614
  declare module '@mappedin/mappedin-js/geojson/src/entities/utils' {
9370
- import type { CollisionRankingTier, GeometryState, LabelState, PathState, RendererCore } from '@mappedin/mappedin-js/geojson/src';
9615
+ import type { CollisionRankingTier, GeometryState, LabelState, RendererCore } from '@mappedin/mappedin-js/geojson/src';
9371
9616
  import { type MarkerState } from '@mappedin/mappedin-js/geojson/src/components/marker';
9617
+ import type { PathUpdateState } from '@mappedin/mappedin-js/geojson/src/components/path';
9372
9618
  import type { Geometry3DTypes, Position, RendererState } from '@mappedin/mappedin-js/geojson/src/renderer';
9373
9619
  import { GeometryGroupObject3D, type GeometryGroupState } from '@mappedin/mappedin-js/geojson/src/entities/geometry-group';
9374
9620
  import { GroupContainerObject3D } from '@mappedin/mappedin-js/geojson/src/entities/group-container';
@@ -9385,7 +9631,6 @@ declare module '@mappedin/mappedin-js/geojson/src/entities/utils' {
9385
9631
  export function updatePosition(entity: Geometry3D | Geometry2D | GeometryGroupObject3D | GroupContainerObject3D, update: Position | undefined, convertTo3DMapPosition: RendererCore['convertTo3DMapPosition']): void;
9386
9632
  export function updateParent(entity: Geometry3D | Geometry2D | GeometryGroupObject3D | GroupContainerObject3D, update: GroupContainerObject3D | undefined): boolean;
9387
9633
  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
9634
  export function updateMarker(entity: Geometry3D | Geometry2D | GeometryGroupObject3D | GroupContainerObject3D, update: Partial<MarkerState> | undefined, state: RendererState): boolean;
9390
9635
  export function updateRank(entity: Geometry3D | Geometry2D | GeometryGroupObject3D | GroupContainerObject3D, update: CollisionRankingTier | undefined): boolean;
9391
9636
  export function updateLabel(entity: Geometry3D | Geometry2D | GeometryGroupObject3D | GroupContainerObject3D, update: Partial<LabelState> | undefined, state: RendererState): void;
@@ -9398,6 +9643,8 @@ declare module '@mappedin/mappedin-js/geojson/src/entities/utils' {
9398
9643
  export function updateIndividualGeometryOpacity(entity: Geometry3D, update?: number): boolean;
9399
9644
  export function updateAltitude(entity: Geometry3D | Geometry2D | GeometryGroupObject3D | GroupContainerObject3D, update?: number): boolean;
9400
9645
  export function updateOutline(entity: Geometry3DTypes, update?: boolean): boolean;
9646
+ export function handlePathUpdate(geometry: Geometry3D, update: PathUpdateState): void;
9647
+ export function pickPathOptions(update: PathUpdateState): Partial<PathUpdateState>;
9401
9648
  }
9402
9649
 
9403
9650
  declare module '@mappedin/mappedin-js/geojson/src/systems/collisions/collider-processor' {