@mappedin/events 6.6.0-beta.0 → 6.8.0-beta.0
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.
- package/lib/esm/index.d.ts +68 -329
- package/lib/esm/index.js +1 -1
- package/package.json +2 -2
package/lib/esm/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AnnotationCollection, AnnotationSymbol, AreaCollection, AreaId, Category as MVFCategory, CategoryId, Connection as MVFConnection, Details, EnterpriseCategory as MVFEnterpriseCategory, EnterpriseCategory as MvfEnterpriseCategory, EnterpriseCategoryId as MVFEnterpriseCategoryId, EnterpriseLocation as MVFEnterpriseLocation, EnterpriseLocation as MvfEnterpriseLocation, EnterpriseLocationId as MVFEnterpriseLocationId, EnterpriseLocationInstance, EnterpriseVenue as MVFEnterpriseVenue, EntranceCollection, EntranceFeature, Facade as MVFFacade, Feature, Feature as MVFFeature, FeatureCollection, FloorCollection, FloorProperties as MVFFloor, FloorProperties as MvfFloor, FloorStack as MVFFloorStack, FloorStack as MvfFloorStack, Geometry, Hyperlink as MVFHyperlink, Image as MVFImage, Language, LineStringStyle as TMVFLineStringStyle, Location as
|
|
1
|
+
import { AnnotationCollection, AnnotationSymbol, AreaCollection, AreaId, Category as MVFCategory, CategoryId, Connection as MVFConnection, Details, EnterpriseCategory as MVFEnterpriseCategory, EnterpriseCategory as MvfEnterpriseCategory, EnterpriseCategoryId as MVFEnterpriseCategoryId, EnterpriseLocation as MVFEnterpriseLocation, EnterpriseLocation as MvfEnterpriseLocation, EnterpriseLocationId as MVFEnterpriseLocationId, EnterpriseLocationInstance, EnterpriseVenue as MVFEnterpriseVenue, EnterpriseVenueType, EntranceCollection, EntranceFeature, Facade as MVFFacade, Feature, Feature as MVFFeature, FeatureCollection, FloorCollection, FloorProperties as MVFFloor, FloorProperties as MvfFloor, FloorStack as MVFFloorStack, FloorStack as MvfFloorStack, Geometry, Hyperlink as MVFHyperlink, Image as MVFImage, Language, LineStringStyle as TMVFLineStringStyle, Location as MVF2Location, LocationId, LocationLink, LocationSocial, LocationState, MultiPolygon, NavigationFlagDeclarations, NodeCollection, NodeCollection as MVFNodeCollection, NodeId, ObstructionCollection, ObstructionFeature, ObstructionId, ObstructionProperties, OpeningHoursSpecification, OperationHours, ParsedMVF, ParsedMVF as TMVF, ParsedMVFLocalePack, ParsedMVFv3, Point, PointStyle as TMVFPointStyle, Polygon, PolygonStyle as TMVFPolygonStyle, SiblingGroup, SpaceCollection, SpaceFeature, SpaceId, SpaceProperties, Style as TMVFStyle, StyleCollection as TMVFStyleCollection, TilesetStyle } from '@mappedin/mvf-v2';
|
|
2
2
|
import { ParsedMVF } from '@mappedin/mvf-v2/no-validator';
|
|
3
3
|
|
|
4
4
|
declare const VALID_CONTEXTS: readonly [
|
|
@@ -3918,13 +3918,37 @@ declare class PubSub<EVENT_PAYLOAD, EVENT extends keyof EVENT_PAYLOAD = keyof EV
|
|
|
3918
3918
|
/**
|
|
3919
3919
|
* @private
|
|
3920
3920
|
* @internal
|
|
3921
|
+
* AbortController for managing lifecycle and cleanup
|
|
3921
3922
|
*/
|
|
3922
|
-
private
|
|
3923
|
+
private _abortController;
|
|
3924
|
+
/**
|
|
3925
|
+
* @protected
|
|
3926
|
+
* @internal
|
|
3927
|
+
* Tracks all cleanup functions for subscriptions made via on()
|
|
3928
|
+
*/
|
|
3929
|
+
protected _cleanupFunctions: Array<() => void>;
|
|
3930
|
+
/**
|
|
3931
|
+
* Returns the AbortSignal for this PubSub instance.
|
|
3932
|
+
* Use this signal with APIs that support cancellation (fetch, addEventListener, etc.)
|
|
3933
|
+
* When the PubSub is destroyed, the signal will be aborted and all listeners using it will be automatically removed.
|
|
3934
|
+
*
|
|
3935
|
+
* @example
|
|
3936
|
+
* ```typescript
|
|
3937
|
+
* // Automatically cleaned up when PubSub is destroyed
|
|
3938
|
+
* pubsub.addEventListener(window, 'resize', handler, { signal: pubsub.signal });
|
|
3939
|
+
* ```
|
|
3940
|
+
*/
|
|
3941
|
+
get signal(): AbortSignal;
|
|
3923
3942
|
/**
|
|
3924
3943
|
* @private
|
|
3925
3944
|
* @internal
|
|
3926
3945
|
*/
|
|
3927
3946
|
publish<EVENT_NAME extends EVENT>(eventName: EVENT_NAME, data?: EVENT_PAYLOAD[EVENT_NAME]): void;
|
|
3947
|
+
/**
|
|
3948
|
+
* Subscribe a function to be called when the signal is aborted.
|
|
3949
|
+
* @param fn The function to call when the signal is aborted.
|
|
3950
|
+
*/
|
|
3951
|
+
onAbort<T extends (...args: any[]) => void>(fn: T): void;
|
|
3928
3952
|
/**
|
|
3929
3953
|
* Subscribe a function to an event.
|
|
3930
3954
|
*
|
|
@@ -3932,6 +3956,9 @@ declare class PubSub<EVENT_PAYLOAD, EVENT extends keyof EVENT_PAYLOAD = keyof EV
|
|
|
3932
3956
|
* function.
|
|
3933
3957
|
* @param fn A callback that gets called when the corresponding event is fired. The
|
|
3934
3958
|
* callback will get passed an argument with a type that's one of event payloads.
|
|
3959
|
+
* @param options Optional options object. If a signal is provided, the subscription will be
|
|
3960
|
+
* automatically cleaned up when that signal is aborted.
|
|
3961
|
+
* @returns A cleanup function that unsubscribes the event listener when called.
|
|
3935
3962
|
* @example
|
|
3936
3963
|
* // Subscribe to the 'click' event
|
|
3937
3964
|
* const handler = (event) => {
|
|
@@ -3943,7 +3970,9 @@ declare class PubSub<EVENT_PAYLOAD, EVENT extends keyof EVENT_PAYLOAD = keyof EV
|
|
|
3943
3970
|
*/
|
|
3944
3971
|
on<EVENT_NAME extends EVENT>(eventName: EVENT_NAME, fn: (payload: EVENT_PAYLOAD[EVENT_NAME] extends {
|
|
3945
3972
|
data: null;
|
|
3946
|
-
} ? EVENT_PAYLOAD[EVENT_NAME]["data"] : EVENT_PAYLOAD[EVENT_NAME]) => void
|
|
3973
|
+
} ? EVENT_PAYLOAD[EVENT_NAME]["data"] : EVENT_PAYLOAD[EVENT_NAME]) => void, options?: {
|
|
3974
|
+
signal?: AbortSignal;
|
|
3975
|
+
}): () => void;
|
|
3947
3976
|
/**
|
|
3948
3977
|
* Unsubscribe a function previously subscribed with {@link on}
|
|
3949
3978
|
*
|
|
@@ -3964,6 +3993,7 @@ declare class PubSub<EVENT_PAYLOAD, EVENT extends keyof EVENT_PAYLOAD = keyof EV
|
|
|
3964
3993
|
/**
|
|
3965
3994
|
* @private
|
|
3966
3995
|
* @internal
|
|
3996
|
+
* Destroys the PubSub instance and automatically unsubscribes all listeners registered via on().
|
|
3967
3997
|
*/
|
|
3968
3998
|
destroy(): void;
|
|
3969
3999
|
}
|
|
@@ -3986,7 +4016,6 @@ type NodeProperties = {
|
|
|
3986
4016
|
* */
|
|
3987
4017
|
[name: string]: any;
|
|
3988
4018
|
};
|
|
3989
|
-
type NodeCollection$1 = FeatureCollection$1<Point$1, NodeProperties>;
|
|
3990
4019
|
type NodeFeature = Feature$1<Point$1, NodeProperties>;
|
|
3991
4020
|
declare class Edge {
|
|
3992
4021
|
/** The originating node of the edge */
|
|
@@ -4016,64 +4045,6 @@ declare class Edge {
|
|
|
4016
4045
|
multiplicativeDistanceWeightScaling?: boolean;
|
|
4017
4046
|
});
|
|
4018
4047
|
}
|
|
4019
|
-
declare class NavigationGraph {
|
|
4020
|
-
#private;
|
|
4021
|
-
readonly edges: {
|
|
4022
|
-
[propName: string]: Edge[];
|
|
4023
|
-
};
|
|
4024
|
-
readonly nodesById: {
|
|
4025
|
-
[propName: string]: NodeFeature;
|
|
4026
|
-
};
|
|
4027
|
-
readonly nodesByGroup: Map<string, NodeFeature[]>;
|
|
4028
|
-
constructor({ nodes, groupBy, multiplicativeDistanceWeightScaling, }: {
|
|
4029
|
-
nodes: NodeCollection$1;
|
|
4030
|
-
groupBy: string;
|
|
4031
|
-
multiplicativeDistanceWeightScaling?: boolean;
|
|
4032
|
-
});
|
|
4033
|
-
/**
|
|
4034
|
-
* Calculates the shortest Euclidean distance from the origin node to any of the destination nodes.
|
|
4035
|
-
*
|
|
4036
|
-
* @param origin - The origin node.
|
|
4037
|
-
* @param destinations - An array of destination nodes.
|
|
4038
|
-
* @returns The shortest Euclidean distance.
|
|
4039
|
-
*/
|
|
4040
|
-
getShortestEuclideanDistance(origin: NodeFeature, destinations: NodeFeature[]): number;
|
|
4041
|
-
hasLineOfSight: (origin: Position, destination: Position, edges?: Position[][], bufferRadius?: number) => boolean;
|
|
4042
|
-
/**
|
|
4043
|
-
* Performs a Dijkstra search to find nodes within a given travel distance that satisfy a goal function, sorted by distance.
|
|
4044
|
-
*
|
|
4045
|
-
* @param originId - Origin node ID.
|
|
4046
|
-
* @param maxTravelDistance - The maximum travel distance.
|
|
4047
|
-
* @param includedNodeIds - Array of node IDs to include in the search.
|
|
4048
|
-
* @param obstructionEdges - Array of obstruction edges for line of sight calculations.
|
|
4049
|
-
* @param useLineOfSight - Whether to use line of sight checking.
|
|
4050
|
-
* @returns An Array of nodes within the travel distance that satisfy the goal function.
|
|
4051
|
-
* - feature: The node feature.
|
|
4052
|
-
* - distance: The distance to the node.
|
|
4053
|
-
* - edges: The edges to the node.
|
|
4054
|
-
*/
|
|
4055
|
-
dijkstraFindWithinTravelDistance(originId: string, maxTravelDistance: number, includedNodeIds: string[], obstructionEdges: Position[][], useLineOfSight: boolean, limitNumberOfResults: number): {
|
|
4056
|
-
feature: NodeFeature;
|
|
4057
|
-
distance: number;
|
|
4058
|
-
}[];
|
|
4059
|
-
/**
|
|
4060
|
-
* Performs A* pathfinding from specified origins to destinations, considering optional constraints like accessibility.
|
|
4061
|
-
*
|
|
4062
|
-
* @param {string[]} originIds - Array of origin node IDs.
|
|
4063
|
-
* @param {string[]} destinationNodeIds - Array of destination node IDs.
|
|
4064
|
-
* @param {Set<string>} [disabledConnectionNodeIds] - Optional set of connection node IDs that are disabled (ie. act as regular nodes).
|
|
4065
|
-
* @param {Set<string>} [disabledNodeIds] - Optional set of node IDs which are ignored during pathfinding.
|
|
4066
|
-
* @returns {Edge[]} An array of edges representing the shortest path, or an empty array if no path is found.
|
|
4067
|
-
*/
|
|
4068
|
-
aStar({ originIds, destinationNodeIds, disabledConnectionNodeIds, zones, overrideEdgeWeights, disabledNodeIds, }: {
|
|
4069
|
-
originIds: string[];
|
|
4070
|
-
destinationNodeIds: string[];
|
|
4071
|
-
zones: DirectionsZone[];
|
|
4072
|
-
disabledConnectionNodeIds?: Set<string>;
|
|
4073
|
-
overrideEdgeWeights?: Map<Edge, number>;
|
|
4074
|
-
disabledNodeIds?: Set<string>;
|
|
4075
|
-
}): Edge[];
|
|
4076
|
-
}
|
|
4077
4048
|
type DirectionProperties = {
|
|
4078
4049
|
/**
|
|
4079
4050
|
* Unique identifier for the direction.
|
|
@@ -4097,198 +4068,6 @@ type DirectionProperties = {
|
|
|
4097
4068
|
};
|
|
4098
4069
|
type DirectionFeature = Feature$1<Point$1, DirectionProperties>;
|
|
4099
4070
|
type DirectionsCollection = FeatureCollection$1<Point$1, DirectionProperties>;
|
|
4100
|
-
interface DoorGeometry {
|
|
4101
|
-
geoJSON: {
|
|
4102
|
-
geometry: {
|
|
4103
|
-
coordinates: [
|
|
4104
|
-
[
|
|
4105
|
-
number,
|
|
4106
|
-
number
|
|
4107
|
-
],
|
|
4108
|
-
[
|
|
4109
|
-
number,
|
|
4110
|
-
number
|
|
4111
|
-
]
|
|
4112
|
-
];
|
|
4113
|
-
};
|
|
4114
|
-
};
|
|
4115
|
-
}
|
|
4116
|
-
type BaseSimplifyOptions = {
|
|
4117
|
-
/**
|
|
4118
|
-
* Enable or disable simplifying.
|
|
4119
|
-
*/
|
|
4120
|
-
enabled: boolean;
|
|
4121
|
-
/**
|
|
4122
|
-
* The radius of the buffer around the path to consider when simplifying, in meters.
|
|
4123
|
-
* @default 0.4
|
|
4124
|
-
*/
|
|
4125
|
-
radius?: number;
|
|
4126
|
-
};
|
|
4127
|
-
type GreedyLosOptions = BaseSimplifyOptions & {
|
|
4128
|
-
__EXPERIMENTAL_METHOD?: "greedy-los";
|
|
4129
|
-
};
|
|
4130
|
-
type RdpOptions = BaseSimplifyOptions & {
|
|
4131
|
-
__EXPERIMENTAL_METHOD: "rdp";
|
|
4132
|
-
};
|
|
4133
|
-
type DpOptimalOptions = BaseSimplifyOptions & {
|
|
4134
|
-
__EXPERIMENTAL_METHOD: "dp-optimal";
|
|
4135
|
-
/**
|
|
4136
|
-
* Whether to include door buffer nodes in DP simplification.
|
|
4137
|
-
* When true, predecessor and successor nodes of doors are marked with preventSmoothing.
|
|
4138
|
-
* @default false
|
|
4139
|
-
*/
|
|
4140
|
-
includeDoorBufferNodes?: boolean;
|
|
4141
|
-
};
|
|
4142
|
-
type SimplifyDirectionsOptions = GreedyLosOptions | RdpOptions | DpOptimalOptions;
|
|
4143
|
-
type DirectionsZone = {
|
|
4144
|
-
geometry: Feature$1<MultiPolygon$1 | Polygon$1>;
|
|
4145
|
-
/**
|
|
4146
|
-
* The additional cost for navigation through the zone.
|
|
4147
|
-
*/
|
|
4148
|
-
cost: number;
|
|
4149
|
-
/**
|
|
4150
|
-
*
|
|
4151
|
-
* Additional property specific to the navigator based on the 'groupBy' option.
|
|
4152
|
-
*/
|
|
4153
|
-
[index: string]: any;
|
|
4154
|
-
};
|
|
4155
|
-
declare class Navigator$1 {
|
|
4156
|
-
private groupBy;
|
|
4157
|
-
graph: NavigationGraph;
|
|
4158
|
-
private geometryEdgesByMapId;
|
|
4159
|
-
private flagDeclarations;
|
|
4160
|
-
private getDoorByNodeId;
|
|
4161
|
-
private disabledNodeIds;
|
|
4162
|
-
/**
|
|
4163
|
-
* Constructs a Navigator instance to manage pathfinding with optional obstructions and grouping features.
|
|
4164
|
-
*
|
|
4165
|
-
* @param {NodeCollection} nodes - Collection of nodes for the navigation graph.
|
|
4166
|
-
* @param {ObstructionCollection} [obstructions] - Optional collection of obstructions that could block paths.
|
|
4167
|
-
* @param {SpaceCollection} [spaces] - Optional collection of spaces that could block paths.
|
|
4168
|
-
* @param {string} [groupBy] - Optional property name to group nodes and paths for differentiated processing.
|
|
4169
|
-
* @param {Function} getDoorByNodeId - Function to get door object by node ID.
|
|
4170
|
-
*/
|
|
4171
|
-
constructor({ nodes, geojsonCollection, groupBy, multiplicativeDistanceWeightScaling, flagDeclarations, getDoorByNodeId, }: {
|
|
4172
|
-
nodes: NodeCollection$1;
|
|
4173
|
-
geojsonCollection?: ObstructionCollection | SpaceCollection;
|
|
4174
|
-
groupBy?: string;
|
|
4175
|
-
multiplicativeDistanceWeightScaling?: boolean;
|
|
4176
|
-
flagDeclarations?: NavigationFlagDeclarations;
|
|
4177
|
-
getDoorByNodeId: (nodeId: string) => DoorGeometry | undefined;
|
|
4178
|
-
});
|
|
4179
|
-
private getDisabledNodeIds;
|
|
4180
|
-
/**
|
|
4181
|
-
* Calculates and returns a set of directions from origin nodes to destination nodes, including detailed properties.
|
|
4182
|
-
*
|
|
4183
|
-
* @param {DirectionsZone[]} zones - special zones for navigation operations.
|
|
4184
|
-
* @param {string[]} originIds - IDs of origin nodes.
|
|
4185
|
-
* @param {string[]} destinationNodeIds - IDs of destination nodes.
|
|
4186
|
-
* @param {string[]} [disabledConnectionNodeIds] - IDs of connection nodes that are disabled (ie. act as regular nodes).
|
|
4187
|
-
* @param {SimplifyDirectionsOptions} [simplify] - Options to simplify the pathfinding result.
|
|
4188
|
-
* @returns {DirectionsCollection} A collection of directional features representing the path.
|
|
4189
|
-
*/
|
|
4190
|
-
getDirections({ zones: directionsZones, originIds, from, to, destinationNodeIds, disabledConnectionNodeIds, simplify, multiplicativeDistanceWeightScaling, overrideEdgeWeights, }: {
|
|
4191
|
-
originIds: string[];
|
|
4192
|
-
destinationNodeIds: string[];
|
|
4193
|
-
from: NodeFeature[];
|
|
4194
|
-
to: NodeFeature[];
|
|
4195
|
-
zones?: DirectionsZone[];
|
|
4196
|
-
disabledConnectionNodeIds?: string[];
|
|
4197
|
-
simplify?: SimplifyDirectionsOptions;
|
|
4198
|
-
multiplicativeDistanceWeightScaling?: boolean;
|
|
4199
|
-
overrideEdgeWeights?: Map<Edge, number>;
|
|
4200
|
-
}): DirectionsCollection;
|
|
4201
|
-
/**
|
|
4202
|
-
* Generates a path from a series of edges, constructing a feature collection of directional steps.
|
|
4203
|
-
*
|
|
4204
|
-
* @param {Edge[]} steps - An array of edges representing the path.
|
|
4205
|
-
* @returns {DirectionsCollection} A collection of directional features.
|
|
4206
|
-
*/
|
|
4207
|
-
private generatePath;
|
|
4208
|
-
/**
|
|
4209
|
-
* Simplifies a sequence of steps by reducing unnecessary nodes using line-of-sight checks.
|
|
4210
|
-
*
|
|
4211
|
-
* Method Selection:
|
|
4212
|
-
* - 'greedy-los': Greedy forward scan with line-of-sight validation. Fastest, O(n) time complexity. Good default choice.
|
|
4213
|
-
* - 'rdp': Uses Ramer-Douglas-Peucker preprocessing + line-of-sight validation + door buffer nodes.
|
|
4214
|
-
* Better for paths with doors and complex geometry. Medium speed.
|
|
4215
|
-
* - 'dp-optimal': Dynamic Programming for globally optimal simplification. Slowest but highest quality, O(n²) complexity.
|
|
4216
|
-
* Best when path quality is critical (e.g., indoor navigation with many turns).
|
|
4217
|
-
*
|
|
4218
|
-
* Performance: greedy-los < rdp < dp-optimal
|
|
4219
|
-
* Quality: greedy-los < rdp < dp-optimal
|
|
4220
|
-
*
|
|
4221
|
-
* @param {Edge[]} steps - The steps to simplify.
|
|
4222
|
-
* @param {SimplifyDirectionsOptions} options - Simplification options.
|
|
4223
|
-
* @param {boolean} multiplicativeDistanceWeightScaling - Distance weight scaling option.
|
|
4224
|
-
* @returns {Edge[]} An array of simplified edges representing a more direct path.
|
|
4225
|
-
*/
|
|
4226
|
-
private simplifyAllSteps;
|
|
4227
|
-
/**
|
|
4228
|
-
* Finds the nearest nodes on the graph within a given travel distance.
|
|
4229
|
-
*
|
|
4230
|
-
* @param originId - The ID of the origin node.
|
|
4231
|
-
* @param maxDistance - The maximum distance to search.
|
|
4232
|
-
* @param floorId - The ID of the floor.
|
|
4233
|
-
* @param includedNodeIds - The IDs of the nodes to include.
|
|
4234
|
-
* @param useLineOfSight - Whether to use line of sight.
|
|
4235
|
-
* @returns An array of nodes within the travel distance that satisfy the goal function.
|
|
4236
|
-
*/
|
|
4237
|
-
findNearestNodesOnGraph: (originId: string, maxDistance: number, floorId: string, includedNodeIds: string[], useLineOfSight?: boolean, limitNumberOfResults?: number) => {
|
|
4238
|
-
feature: NodeFeature;
|
|
4239
|
-
distance: number;
|
|
4240
|
-
}[];
|
|
4241
|
-
/**
|
|
4242
|
-
* Checks if there is a line of sight between two points on the map.
|
|
4243
|
-
*
|
|
4244
|
-
* @param origin - The origin point.
|
|
4245
|
-
* @param destination - The destination point.
|
|
4246
|
-
* @param floorId - The ID of the floor.
|
|
4247
|
-
* @param bufferRadius - The buffer radius to use when checking for line of sight.
|
|
4248
|
-
* @returns True if there is a line of sight, false otherwise.
|
|
4249
|
-
*/
|
|
4250
|
-
hasLineOfSight: (origin: [
|
|
4251
|
-
number,
|
|
4252
|
-
number
|
|
4253
|
-
], destination: [
|
|
4254
|
-
number,
|
|
4255
|
-
number
|
|
4256
|
-
], floorId: string, bufferRadius?: number) => boolean;
|
|
4257
|
-
/**
|
|
4258
|
-
* Simplifies a section of steps by checking direct lines of sight between steps and eliminating intermediate nodes if unobstructed.
|
|
4259
|
-
*
|
|
4260
|
-
* @param {Edge[]} steps - The steps to potentially simplify.
|
|
4261
|
-
* @param {[number, number][][]} geometryEdges - The geometrical edges of the map used to check for line of sight.
|
|
4262
|
-
* @param {number} bufferRadius - The buffer radius to use when simplifying.
|
|
4263
|
-
* @returns {Edge[]} An array of simplified edges.
|
|
4264
|
-
*/
|
|
4265
|
-
private simplifySteps;
|
|
4266
|
-
private simplifyStepsImprovedWithSimplifyBeforeLoSChecks;
|
|
4267
|
-
private simplifyStepsWithDPMethod;
|
|
4268
|
-
/**
|
|
4269
|
-
* Calculates the approximate distance between two geographic coordinates on Earth's surface.
|
|
4270
|
-
*
|
|
4271
|
-
* This function uses the equirectangular approximation method to compute the distance, which simplifies
|
|
4272
|
-
* the math and speeds up calculations, but is less accurate over long distances compared to other methods
|
|
4273
|
-
* like the haversine formula.
|
|
4274
|
-
*
|
|
4275
|
-
* @param {Position} point1 - The first point's longitude and latitude as [longitude, latitude].
|
|
4276
|
-
* @param {Position} point2 - The second point's longitude and latitude as [longitude, latitude].
|
|
4277
|
-
* @return
|
|
4278
|
-
* @return {number} The approximate distance between the two points in meters.
|
|
4279
|
-
*/
|
|
4280
|
-
getDistance: (point1: Position, point2: Position) => number;
|
|
4281
|
-
/**
|
|
4282
|
-
* Calculates the angle between two geographic coordinates.
|
|
4283
|
-
*
|
|
4284
|
-
* @param {Position} point1 - The first point's longitude and latitude as [longitude, latitude].
|
|
4285
|
-
* @param {Position} point2 - The second point's longitude and latitude as [longitude, latitude].
|
|
4286
|
-
* @hidden
|
|
4287
|
-
*
|
|
4288
|
-
* @return {number} The angle in radians, calculated clockwise from the north between the two points specified.
|
|
4289
|
-
*/
|
|
4290
|
-
getAngle: (point1: Position, point2: Position) => number;
|
|
4291
|
-
}
|
|
4292
4071
|
declare class Directions {
|
|
4293
4072
|
#private;
|
|
4294
4073
|
id: string;
|
|
@@ -4339,79 +4118,6 @@ declare class Directions {
|
|
|
4339
4118
|
instructions: TDirectionInstruction[];
|
|
4340
4119
|
};
|
|
4341
4120
|
}
|
|
4342
|
-
declare class DirectionsInternal {
|
|
4343
|
-
#private;
|
|
4344
|
-
navigator: Navigator$1;
|
|
4345
|
-
private readonly connections;
|
|
4346
|
-
/**
|
|
4347
|
-
* @hidden
|
|
4348
|
-
*/
|
|
4349
|
-
constructor({ nodes, geojsonCollection, connections, groupBy, multiplicativeDistanceWeightScaling, flagDeclarations, getDoorByNodeId, }: {
|
|
4350
|
-
nodes: ParsedMVF["node.geojson"];
|
|
4351
|
-
geojsonCollection: ParsedMVF["obstruction"] | ParsedMVF["space"];
|
|
4352
|
-
connections: ParsedMVF["connection.json"];
|
|
4353
|
-
groupBy?: string;
|
|
4354
|
-
multiplicativeDistanceWeightScaling?: boolean;
|
|
4355
|
-
flagDeclarations?: ParsedMVF["navigationFlags.json"];
|
|
4356
|
-
getDoorByNodeId: (nodeId: string) => DoorGeometry | undefined;
|
|
4357
|
-
});
|
|
4358
|
-
processTargets(fromNodesByTarget: Map<TNavigationTarget, string[]>, toNodesByTarget: Map<TNavigationTarget, string[]>, mapData: MapDataInternal): {
|
|
4359
|
-
originIds: string[];
|
|
4360
|
-
destinationNodeIds: string[];
|
|
4361
|
-
featureToNodeIdsMap: Map<TNavigationTarget, string[]>;
|
|
4362
|
-
};
|
|
4363
|
-
getDirections: (from: TNavigationTarget[], to: TNavigationTarget[], options: {
|
|
4364
|
-
accessible: boolean;
|
|
4365
|
-
smoothing: SimplifyDirectionsOptions;
|
|
4366
|
-
zones: TDirectionZone[];
|
|
4367
|
-
excludedConnections: Connection[];
|
|
4368
|
-
connectionIdWeightMap: Record<string, number>;
|
|
4369
|
-
}, mapData: MapDataInternal) => Promise<Directions | undefined>;
|
|
4370
|
-
/** @deprecated use getDirections instead */
|
|
4371
|
-
getDirectionsSync: (from: TNavigationTarget[], to: TNavigationTarget[], options: {
|
|
4372
|
-
accessible: boolean;
|
|
4373
|
-
smoothing: SimplifyDirectionsOptions;
|
|
4374
|
-
zones: TDirectionZone[];
|
|
4375
|
-
excludedConnections: Connection[];
|
|
4376
|
-
connectionIdWeightMap: Record<string, number>;
|
|
4377
|
-
}, mapData: MapDataInternal) => Directions | undefined;
|
|
4378
|
-
/**
|
|
4379
|
-
* Get the node IDs of connections that do not match the accessibility setting provided.
|
|
4380
|
-
* A disabled connection node is a connection node that acts as a regular node
|
|
4381
|
-
* (ie. the edges that would cause a floor change are ignored).
|
|
4382
|
-
*
|
|
4383
|
-
* @hidden
|
|
4384
|
-
* @param accessible {boolean}
|
|
4385
|
-
*/
|
|
4386
|
-
getDisabledConnectionNodeIds: (accessible: boolean) => string[];
|
|
4387
|
-
/**
|
|
4388
|
-
* If the navigation targets are coordinates, make sure to include them in the final directions. For other
|
|
4389
|
-
* data types (e.g. POIs, Doors, Spaces), the coordinate should have a coincidental node generated in the
|
|
4390
|
-
* navigation graph already, so this is unnecessary.
|
|
4391
|
-
*
|
|
4392
|
-
* @hidden
|
|
4393
|
-
* @param directions
|
|
4394
|
-
* @param from {TNavigationTarget[]}
|
|
4395
|
-
* @param to {TNavigationTarget[]}
|
|
4396
|
-
*/
|
|
4397
|
-
private addCoordinateDirections;
|
|
4398
|
-
/**
|
|
4399
|
-
* Create an geojson collection from the parsed MVF.
|
|
4400
|
-
*
|
|
4401
|
-
* @hidden
|
|
4402
|
-
* @param obstructions
|
|
4403
|
-
*/
|
|
4404
|
-
private createCollection;
|
|
4405
|
-
/**
|
|
4406
|
-
* Create a direction feature.
|
|
4407
|
-
*
|
|
4408
|
-
* @hidden
|
|
4409
|
-
* @param coordinate
|
|
4410
|
-
* @param angle
|
|
4411
|
-
* @param distance
|
|
4412
|
-
*/
|
|
4413
|
-
private createDirectionFeature;
|
|
4414
|
-
}
|
|
4415
4121
|
declare class Shape implements IFocusable {
|
|
4416
4122
|
/**
|
|
4417
4123
|
* id of Shape
|
|
@@ -4663,6 +4369,13 @@ type TGetDirectionsOptions = {
|
|
|
4663
4369
|
* Always uses line-of-sight validation (cannot be disabled).
|
|
4664
4370
|
*/
|
|
4665
4371
|
__EXPERIMENTAL_METHOD: "rdp";
|
|
4372
|
+
/**
|
|
4373
|
+
* @experimental
|
|
4374
|
+
* Whether to include door-adjacent nodes (predecessor/successor of doors) in the must-include set.
|
|
4375
|
+
* When true (default), nodes immediately before and after doors are preserved during simplification.
|
|
4376
|
+
* @default true
|
|
4377
|
+
*/
|
|
4378
|
+
__EXPERIMENTAL_MUST_INCLUDE_DOOR_BUFFER_NODES?: boolean;
|
|
4666
4379
|
} | {
|
|
4667
4380
|
/**
|
|
4668
4381
|
* Enable or disable path smoothing.
|
|
@@ -4977,7 +4690,8 @@ declare class ImageMetaData extends BaseMetaData {
|
|
|
4977
4690
|
*/
|
|
4978
4691
|
destroy(): void;
|
|
4979
4692
|
}
|
|
4980
|
-
type
|
|
4693
|
+
type MVF3Location = Required<ParsedMVFv3>["locations"][number];
|
|
4694
|
+
type LocationData = Omit<MVF2Location, "categories" | "spaces" | "obstructions" | "entrances" | "shapes" | "connections" | "annotations" | "areas" | "openingHoursSpecification" | "links" | "pictures" | "website" | "icon"> & {
|
|
4981
4695
|
links: Hyperlink[];
|
|
4982
4696
|
images: ImageMetaData[];
|
|
4983
4697
|
icon?: ImageMetaData;
|
|
@@ -5032,9 +4746,28 @@ declare class LocationProfile extends BaseMetaData implements LocationData, IFoc
|
|
|
5032
4746
|
* @format uri
|
|
5033
4747
|
*/
|
|
5034
4748
|
icon?: ImageMetaData;
|
|
4749
|
+
/**
|
|
4750
|
+
* Additional user defined data. The type is unknown, so it is recommended to validate the data before use.
|
|
4751
|
+
*
|
|
4752
|
+
* _Only available when loading MVFv3 data._
|
|
4753
|
+
*
|
|
4754
|
+
* ```ts
|
|
4755
|
+
* const mapData = await getMapData({
|
|
4756
|
+
* ...
|
|
4757
|
+
* mvfVersion: '3.0.0',
|
|
4758
|
+
* });
|
|
4759
|
+
*
|
|
4760
|
+
* const locationProfile = mapData.getById('location-profile', id);
|
|
4761
|
+
* if (typeof locationProfile?.extra?.myProperty === 'string') {
|
|
4762
|
+
* // Do something
|
|
4763
|
+
* }
|
|
4764
|
+
* ```
|
|
4765
|
+
*/
|
|
4766
|
+
extra?: Record<string, unknown>;
|
|
5035
4767
|
/** @internal */
|
|
5036
4768
|
constructor(data: MapDataInternal, options: {
|
|
5037
|
-
|
|
4769
|
+
mvf2Data: MVF2Location;
|
|
4770
|
+
mvf3Data?: MVF3Location;
|
|
5038
4771
|
});
|
|
5039
4772
|
/**
|
|
5040
4773
|
* Gets the {@link Space}s associated with the location.
|
|
@@ -5878,6 +5611,7 @@ type TMapDataInternalOptions = {
|
|
|
5878
5611
|
binaryBundle?: Uint8Array;
|
|
5879
5612
|
tokenManager?: TokenManager;
|
|
5880
5613
|
getMapDataOptions?: TGetMapDataOptions;
|
|
5614
|
+
mvf3?: ParsedMVFv3;
|
|
5881
5615
|
};
|
|
5882
5616
|
type MVFNodeFeature = MVFNodeCollection["features"][number];
|
|
5883
5617
|
type MVFFloorFeature = FloorCollection["features"][number];
|
|
@@ -6305,6 +6039,7 @@ type MapDataRecords = {
|
|
|
6305
6039
|
[floorId: string]: AnnotationCollection["features"][number][];
|
|
6306
6040
|
};
|
|
6307
6041
|
mvfAreasById: Record<AreaId, AreaCollection["features"][number]>;
|
|
6042
|
+
mvf3LocationsById: Record<string, Required<ParsedMVFv3>["locations"][number]>;
|
|
6308
6043
|
};
|
|
6309
6044
|
type EnterpriseMapDataRecords = {
|
|
6310
6045
|
connectionsByExternalId: Record<string, Connection[]>;
|
|
@@ -6684,6 +6419,10 @@ declare class EnterpriseVenue extends BaseMetaData implements MVFEnterpriseVenue
|
|
|
6684
6419
|
* The default map of the venue.
|
|
6685
6420
|
*/
|
|
6686
6421
|
get defaultMap(): string;
|
|
6422
|
+
/**
|
|
6423
|
+
* The enterprise venue type.
|
|
6424
|
+
*/
|
|
6425
|
+
get enterpriseType(): EnterpriseVenueType | undefined;
|
|
6687
6426
|
/**
|
|
6688
6427
|
* Serializes the EnterpriseVenue data to JSON.
|
|
6689
6428
|
*
|