@stadiamaps/ferrostar 0.46.1 → 0.47.2
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/ferrostar.d.ts +312 -292
- package/ferrostar_bg.js +1 -1
- package/ferrostar_bg.wasm +0 -0
- package/package.json +1 -1
package/ferrostar.d.ts
CHANGED
|
@@ -1,21 +1,5 @@
|
|
|
1
1
|
/* tslint:disable */
|
|
2
2
|
/* eslint-disable */
|
|
3
|
-
/**
|
|
4
|
-
* Details about congestion for an incident.
|
|
5
|
-
*/
|
|
6
|
-
export interface Congestion {
|
|
7
|
-
/**
|
|
8
|
-
* The level of congestion caused by the incident.
|
|
9
|
-
*
|
|
10
|
-
* 0 = no congestion
|
|
11
|
-
*
|
|
12
|
-
* 100 = road closed
|
|
13
|
-
*
|
|
14
|
-
* Other values mean no congestion was calculated
|
|
15
|
-
*/
|
|
16
|
-
value: number;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
3
|
/**
|
|
20
4
|
* The location of the user that is navigating.
|
|
21
5
|
*
|
|
@@ -37,19 +21,16 @@ export interface UserLocation {
|
|
|
37
21
|
}
|
|
38
22
|
|
|
39
23
|
/**
|
|
40
|
-
* The
|
|
24
|
+
* The type of incident that has occurred.
|
|
41
25
|
*/
|
|
42
|
-
export
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
*/
|
|
51
|
-
accuracy: number | undefined;
|
|
52
|
-
}
|
|
26
|
+
export type IncidentType = "accident" | "congestion" | "construction" | "disabled_vehicle" | "lane_restriction" | "mass_transit" | "miscellaneous" | "other_news" | "planned_event" | "road_closure" | "road_hazard" | "weather";
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* The broad class of maneuver to perform.
|
|
30
|
+
*
|
|
31
|
+
* This is usually combined with [`ManeuverModifier`] in [`VisualInstructionContent`].
|
|
32
|
+
*/
|
|
33
|
+
export type ManeuverType = "turn" | "new name" | "depart" | "arrive" | "merge" | "on ramp" | "off ramp" | "fork" | "end of road" | "continue" | "roundabout" | "rotary" | "roundabout turn" | "notification" | "exit roundabout" | "exit rotary";
|
|
53
34
|
|
|
54
35
|
/**
|
|
55
36
|
* An instruction that can be synthesized using a TTS engine to announce an upcoming maneuver.
|
|
@@ -83,55 +64,17 @@ export interface SpokenInstruction {
|
|
|
83
64
|
}
|
|
84
65
|
|
|
85
66
|
/**
|
|
86
|
-
*
|
|
87
|
-
*/
|
|
88
|
-
export interface VisualInstruction {
|
|
89
|
-
/**
|
|
90
|
-
* The primary instruction content.
|
|
91
|
-
*
|
|
92
|
-
* This is usually given more visual weight.
|
|
93
|
-
*/
|
|
94
|
-
primaryContent: VisualInstructionContent;
|
|
95
|
-
/**
|
|
96
|
-
* Optional secondary instruction content.
|
|
97
|
-
*/
|
|
98
|
-
secondaryContent: VisualInstructionContent | undefined;
|
|
99
|
-
/**
|
|
100
|
-
* Optional sub-maneuver instruction content.
|
|
101
|
-
*/
|
|
102
|
-
subContent: VisualInstructionContent | undefined;
|
|
103
|
-
/**
|
|
104
|
-
* How far (in meters) from the upcoming maneuver the instruction should start being displayed
|
|
105
|
-
*/
|
|
106
|
-
triggerDistanceBeforeManeuver: number;
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
/**
|
|
110
|
-
* The content of a visual instruction.
|
|
111
|
-
*/
|
|
112
|
-
export interface LaneInfo {
|
|
113
|
-
active: boolean;
|
|
114
|
-
directions: string[];
|
|
115
|
-
activeDirection: string | undefined;
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
/**
|
|
119
|
-
* The lane type blocked by the incident.
|
|
120
|
-
*/
|
|
121
|
-
export type BlockedLane = "left" | "left center" | "left turn lane" | "center" | "right" | "right center" | "right turn lane" | "hov";
|
|
122
|
-
|
|
123
|
-
/**
|
|
124
|
-
* The speed of the user from the location provider.
|
|
67
|
+
* A geographic bounding box defined by its corners.
|
|
125
68
|
*/
|
|
126
|
-
export interface
|
|
69
|
+
export interface BoundingBox {
|
|
127
70
|
/**
|
|
128
|
-
* The
|
|
71
|
+
* The southwest corner of the bounding box.
|
|
129
72
|
*/
|
|
130
|
-
|
|
73
|
+
sw: GeographicCoordinate;
|
|
131
74
|
/**
|
|
132
|
-
* The
|
|
75
|
+
* The northeast corner of the bounding box.
|
|
133
76
|
*/
|
|
134
|
-
|
|
77
|
+
ne: GeographicCoordinate;
|
|
135
78
|
}
|
|
136
79
|
|
|
137
80
|
/**
|
|
@@ -220,72 +163,48 @@ export interface Incident {
|
|
|
220
163
|
}
|
|
221
164
|
|
|
222
165
|
/**
|
|
223
|
-
*
|
|
166
|
+
* The direction in which the user/device is observed to be traveling.
|
|
224
167
|
*/
|
|
225
|
-
export interface
|
|
168
|
+
export interface CourseOverGround {
|
|
226
169
|
/**
|
|
227
|
-
* The
|
|
170
|
+
* The direction in which the user\'s device is traveling, measured in clockwise degrees from
|
|
171
|
+
* true north (N = 0, E = 90, S = 180, W = 270).
|
|
228
172
|
*/
|
|
229
|
-
|
|
173
|
+
degrees: number;
|
|
230
174
|
/**
|
|
231
|
-
* The
|
|
175
|
+
* The accuracy of the course value, measured in degrees.
|
|
232
176
|
*/
|
|
233
|
-
|
|
177
|
+
accuracy: number | undefined;
|
|
234
178
|
}
|
|
235
179
|
|
|
236
180
|
/**
|
|
237
|
-
*
|
|
238
|
-
*/
|
|
239
|
-
export type IncidentType = "accident" | "congestion" | "construction" | "disabled_vehicle" | "lane_restriction" | "mass_transit" | "miscellaneous" | "other_news" | "planned_event" | "road_closure" | "road_hazard" | "weather";
|
|
240
|
-
|
|
241
|
-
/**
|
|
242
|
-
* Additional information to further specify a [`ManeuverType`].
|
|
243
|
-
*/
|
|
244
|
-
export type ManeuverModifier = "uturn" | "sharp right" | "right" | "slight right" | "straight" | "slight left" | "left" | "sharp left";
|
|
245
|
-
|
|
246
|
-
/**
|
|
247
|
-
* The impact of the incident that has occurred.
|
|
248
|
-
*/
|
|
249
|
-
export type Impact = "unknown" | "critical" | "major" | "minor" | "low";
|
|
250
|
-
|
|
251
|
-
/**
|
|
252
|
-
* A waypoint along a route.
|
|
253
|
-
*
|
|
254
|
-
* Within the context of Ferrostar, a route request consists of exactly one [`UserLocation`]
|
|
255
|
-
* and at least one [`Waypoint`]. The route starts from the user\'s location (which may
|
|
256
|
-
* contain other useful information like their current course for the [`crate::routing_adapters::RouteRequestGenerator`]
|
|
257
|
-
* to use) and proceeds through one or more waypoints.
|
|
258
|
-
*
|
|
259
|
-
* Waypoints are used during route calculation, are tracked throughout the lifecycle of a trip,
|
|
260
|
-
* and are used for recalculating when the user deviates from the expected route.
|
|
261
|
-
*
|
|
262
|
-
* Note that support for properties beyond basic geographic coordinates varies by routing engine.
|
|
181
|
+
* Details about congestion for an incident.
|
|
263
182
|
*/
|
|
264
|
-
export interface
|
|
265
|
-
coordinate: GeographicCoordinate;
|
|
266
|
-
kind: WaypointKind;
|
|
183
|
+
export interface Congestion {
|
|
267
184
|
/**
|
|
268
|
-
*
|
|
269
|
-
*
|
|
270
|
-
* Most users should prefer convenience functions like [`Waypoint::new_with_valhalla_properties`]
|
|
271
|
-
* (or, on platforms like iOS and Android with `UniFFI` bindings, [`crate::routing_adapters::valhalla::create_waypoint_with_valhalla_properties`]).
|
|
272
|
-
*
|
|
273
|
-
* # Format guidelines
|
|
185
|
+
* The level of congestion caused by the incident.
|
|
274
186
|
*
|
|
275
|
-
*
|
|
276
|
-
* However, to promote interoperability, all implementations in the Ferrostar codebase
|
|
277
|
-
* MUST use JSON.
|
|
187
|
+
* 0 = no congestion
|
|
278
188
|
*
|
|
279
|
-
*
|
|
280
|
-
* but because generics (i.e., becoming `Waypoint<T>`, where an example `T` is `ValhallaProperties`)
|
|
281
|
-
* would be way too painful, particularly for foreign code.
|
|
282
|
-
* Especially JavaScript.
|
|
189
|
+
* 100 = road closed
|
|
283
190
|
*
|
|
284
|
-
*
|
|
285
|
-
* implementations SHOULD document their level support for this,
|
|
286
|
-
* ideally with an exportable record type.
|
|
191
|
+
* Other values mean no congestion was calculated
|
|
287
192
|
*/
|
|
288
|
-
|
|
193
|
+
value: number;
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
/**
|
|
197
|
+
* A geographic coordinate in WGS84.
|
|
198
|
+
*/
|
|
199
|
+
export interface GeographicCoordinate {
|
|
200
|
+
/**
|
|
201
|
+
* The latitude (in degrees).
|
|
202
|
+
*/
|
|
203
|
+
lat: number;
|
|
204
|
+
/**
|
|
205
|
+
* The Longitude (in degrees).
|
|
206
|
+
*/
|
|
207
|
+
lng: number;
|
|
289
208
|
}
|
|
290
209
|
|
|
291
210
|
/**
|
|
@@ -323,9 +242,78 @@ export interface VisualInstructionContent {
|
|
|
323
242
|
}
|
|
324
243
|
|
|
325
244
|
/**
|
|
326
|
-
*
|
|
245
|
+
* An instruction for visual display (usually as banners) at a specific point along a [`RouteStep`].
|
|
327
246
|
*/
|
|
328
|
-
export
|
|
247
|
+
export interface VisualInstruction {
|
|
248
|
+
/**
|
|
249
|
+
* The primary instruction content.
|
|
250
|
+
*
|
|
251
|
+
* This is usually given more visual weight.
|
|
252
|
+
*/
|
|
253
|
+
primaryContent: VisualInstructionContent;
|
|
254
|
+
/**
|
|
255
|
+
* Optional secondary instruction content.
|
|
256
|
+
*/
|
|
257
|
+
secondaryContent: VisualInstructionContent | undefined;
|
|
258
|
+
/**
|
|
259
|
+
* Optional sub-maneuver instruction content.
|
|
260
|
+
*/
|
|
261
|
+
subContent: VisualInstructionContent | undefined;
|
|
262
|
+
/**
|
|
263
|
+
* How far (in meters) from the upcoming maneuver the instruction should start being displayed
|
|
264
|
+
*/
|
|
265
|
+
triggerDistanceBeforeManeuver: number;
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
/**
|
|
269
|
+
* The speed of the user from the location provider.
|
|
270
|
+
*/
|
|
271
|
+
export interface Speed {
|
|
272
|
+
/**
|
|
273
|
+
* The user\'s speed in meters per second.
|
|
274
|
+
*/
|
|
275
|
+
value: number;
|
|
276
|
+
/**
|
|
277
|
+
* The accuracy of the speed value, measured in meters per second.
|
|
278
|
+
*/
|
|
279
|
+
accuracy: number | undefined;
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
/**
|
|
283
|
+
* The content of a visual instruction.
|
|
284
|
+
*/
|
|
285
|
+
export interface LaneInfo {
|
|
286
|
+
active: boolean;
|
|
287
|
+
directions: string[];
|
|
288
|
+
activeDirection: string | undefined;
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
/**
|
|
292
|
+
* The impact of the incident that has occurred.
|
|
293
|
+
*/
|
|
294
|
+
export type Impact = "unknown" | "critical" | "major" | "minor" | "low";
|
|
295
|
+
|
|
296
|
+
/**
|
|
297
|
+
* Information describing the series of steps needed to travel between two or more points.
|
|
298
|
+
*
|
|
299
|
+
* NOTE: This type is unstable and is still under active development and should be
|
|
300
|
+
* considered unstable.
|
|
301
|
+
*/
|
|
302
|
+
export interface Route {
|
|
303
|
+
geometry: GeographicCoordinate[];
|
|
304
|
+
bbox: BoundingBox;
|
|
305
|
+
/**
|
|
306
|
+
* The total route distance, in meters.
|
|
307
|
+
*/
|
|
308
|
+
distance: number;
|
|
309
|
+
/**
|
|
310
|
+
* The ordered list of waypoints to visit, including the starting point.
|
|
311
|
+
* Note that this is distinct from the *geometry* which includes all points visited.
|
|
312
|
+
* A waypoint represents a start/end point for a route leg.
|
|
313
|
+
*/
|
|
314
|
+
waypoints: Waypoint[];
|
|
315
|
+
steps: RouteStep[];
|
|
316
|
+
}
|
|
329
317
|
|
|
330
318
|
/**
|
|
331
319
|
* A maneuver (such as a turn or merge) followed by travel of a certain distance until reaching
|
|
@@ -376,130 +364,87 @@ export interface RouteStep {
|
|
|
376
364
|
* A list of incidents that occur along the step.
|
|
377
365
|
*/
|
|
378
366
|
incidents: Incident[];
|
|
367
|
+
/**
|
|
368
|
+
* Which side of the road traffic drives on for this step.
|
|
369
|
+
*
|
|
370
|
+
* This is relevant for roundabouts: left-hand traffic (e.g. UK) uses clockwise roundabouts,
|
|
371
|
+
* while right-hand traffic uses counterclockwise roundabouts.
|
|
372
|
+
*/
|
|
373
|
+
drivingSide: DrivingSide | undefined;
|
|
374
|
+
/**
|
|
375
|
+
* The exit number when entering a roundabout (1 = first exit, 2 = second, etc.).
|
|
376
|
+
*/
|
|
377
|
+
roundaboutExitNumber: number | undefined;
|
|
379
378
|
}
|
|
380
379
|
|
|
381
380
|
/**
|
|
382
|
-
*
|
|
383
|
-
*
|
|
384
|
-
* This is usually combined with [`ManeuverModifier`] in [`VisualInstructionContent`].
|
|
385
|
-
*/
|
|
386
|
-
export type ManeuverType = "turn" | "new name" | "depart" | "arrive" | "merge" | "on ramp" | "off ramp" | "fork" | "end of road" | "continue" | "roundabout" | "rotary" | "roundabout turn" | "notification" | "exit roundabout" | "exit rotary";
|
|
387
|
-
|
|
388
|
-
/**
|
|
389
|
-
* Information describing the series of steps needed to travel between two or more points.
|
|
381
|
+
* A waypoint along a route.
|
|
390
382
|
*
|
|
391
|
-
*
|
|
392
|
-
*
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
distance: number;
|
|
401
|
-
/**
|
|
402
|
-
* The ordered list of waypoints to visit, including the starting point.
|
|
403
|
-
* Note that this is distinct from the *geometry* which includes all points visited.
|
|
404
|
-
* A waypoint represents a start/end point for a route leg.
|
|
405
|
-
*/
|
|
406
|
-
waypoints: Waypoint[];
|
|
407
|
-
steps: RouteStep[];
|
|
408
|
-
}
|
|
409
|
-
|
|
410
|
-
/**
|
|
411
|
-
* A geographic bounding box defined by its corners.
|
|
383
|
+
* Within the context of Ferrostar, a route request consists of exactly one [`UserLocation`]
|
|
384
|
+
* and at least one [`Waypoint`]. The route starts from the user\'s location (which may
|
|
385
|
+
* contain other useful information like their current course for the [`crate::routing_adapters::RouteRequestGenerator`]
|
|
386
|
+
* to use) and proceeds through one or more waypoints.
|
|
387
|
+
*
|
|
388
|
+
* Waypoints are used during route calculation, are tracked throughout the lifecycle of a trip,
|
|
389
|
+
* and are used for recalculating when the user deviates from the expected route.
|
|
390
|
+
*
|
|
391
|
+
* Note that support for properties beyond basic geographic coordinates varies by routing engine.
|
|
412
392
|
*/
|
|
413
|
-
export interface
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
*/
|
|
417
|
-
sw: GeographicCoordinate;
|
|
393
|
+
export interface Waypoint {
|
|
394
|
+
coordinate: GeographicCoordinate;
|
|
395
|
+
kind: WaypointKind;
|
|
418
396
|
/**
|
|
419
|
-
*
|
|
397
|
+
* Optional additional properties that will be passed on to the [`crate::routing_adapters::RouteRequestGenerator`].
|
|
398
|
+
*
|
|
399
|
+
* Most users should prefer convenience functions like [`Waypoint::new_with_valhalla_properties`]
|
|
400
|
+
* (or, on platforms like iOS and Android with `UniFFI` bindings, [`crate::routing_adapters::valhalla::create_waypoint_with_valhalla_properties`]).
|
|
401
|
+
*
|
|
402
|
+
* # Format guidelines
|
|
403
|
+
*
|
|
404
|
+
* This MAY be any format agreed upon by both the request generator and response parser.
|
|
405
|
+
* However, to promote interoperability, all implementations in the Ferrostar codebase
|
|
406
|
+
* MUST use JSON.
|
|
407
|
+
*
|
|
408
|
+
* We selected JSON is selected not because it is good,
|
|
409
|
+
* but because generics (i.e., becoming `Waypoint<T>`, where an example `T` is `ValhallaProperties`)
|
|
410
|
+
* would be way too painful, particularly for foreign code.
|
|
411
|
+
* Especially JavaScript.
|
|
412
|
+
*
|
|
413
|
+
* In any case, [`crate::routing_adapters::RouteRequestGenerator`] and [`crate::routing_adapters::RouteResponseParser`]
|
|
414
|
+
* implementations SHOULD document their level support for this,
|
|
415
|
+
* ideally with an exportable record type.
|
|
420
416
|
*/
|
|
421
|
-
|
|
422
|
-
}
|
|
423
|
-
|
|
424
|
-
/**
|
|
425
|
-
* The current state of the simulation.
|
|
426
|
-
*/
|
|
427
|
-
export interface LocationSimulationState {
|
|
428
|
-
current_location: UserLocation;
|
|
429
|
-
remaining_locations: GeographicCoordinate[];
|
|
430
|
-
bias: LocationBias;
|
|
417
|
+
properties: number[] | undefined;
|
|
431
418
|
}
|
|
432
419
|
|
|
433
|
-
export type SimulationError = { PolylineError: { error: string } } | "NotEnoughPoints";
|
|
434
|
-
|
|
435
|
-
/**
|
|
436
|
-
* Controls how simulated locations deviate from the actual route line.
|
|
437
|
-
* This simulates real-world GPS behavior where readings often have systematic bias.
|
|
438
|
-
*/
|
|
439
|
-
export type LocationBias = { Left: number } | { Right: number } | { Random: number } | "None";
|
|
440
|
-
|
|
441
420
|
/**
|
|
442
|
-
*
|
|
443
|
-
*/
|
|
444
|
-
export type WellKnownRouteProvider = { Valhalla: { endpointUrl: string; profile: string; optionsJson?: string | undefined } } | { GraphHopper: { endpointUrl: string; profile: string; locale: string; voiceUnits: GraphHopperVoiceUnits; optionsJson?: string | undefined } };
|
|
445
|
-
|
|
446
|
-
/**
|
|
447
|
-
* An event that occurs during navigation.
|
|
448
|
-
*
|
|
449
|
-
* This is used for the optional session recording / telemetry.
|
|
421
|
+
* Additional information to further specify a [`ManeuverType`].
|
|
450
422
|
*/
|
|
451
|
-
export
|
|
452
|
-
/**
|
|
453
|
-
* The timestamp of the event in milliseconds since Jan 1, 1970 UTC.
|
|
454
|
-
*/
|
|
455
|
-
timestamp: number;
|
|
456
|
-
/**
|
|
457
|
-
* Data associated with the event.
|
|
458
|
-
*/
|
|
459
|
-
event_data: NavigationRecordingEventData;
|
|
460
|
-
}
|
|
423
|
+
export type ManeuverModifier = "uturn" | "sharp right" | "right" | "slight right" | "straight" | "slight left" | "left" | "sharp left";
|
|
461
424
|
|
|
462
425
|
/**
|
|
463
|
-
*
|
|
464
|
-
*
|
|
465
|
-
* For full replayability, we record things like rerouting, and not just location updates.
|
|
426
|
+
* Describes characteristics of the waypoint for routing purposes.
|
|
466
427
|
*/
|
|
467
|
-
export type
|
|
428
|
+
export type WaypointKind = "Break" | "Via";
|
|
468
429
|
|
|
469
430
|
/**
|
|
470
|
-
*
|
|
431
|
+
* Which side of the road traffic drives on.
|
|
471
432
|
*
|
|
472
|
-
*
|
|
473
|
-
*
|
|
474
|
-
*
|
|
475
|
-
* Similarly, if your server is OSRM-compatible and returns additional attributes,
|
|
476
|
-
* feel free to open a PR to include these as optional properties.
|
|
433
|
+
* This is needed by consumers like Android Auto to determine whether
|
|
434
|
+
* a roundabout should be rendered as clockwise (right-hand traffic)
|
|
435
|
+
* or counterclockwise (left-hand traffic).
|
|
477
436
|
*/
|
|
478
|
-
export
|
|
479
|
-
/**
|
|
480
|
-
* The name of the street that the waypoint snapped to.
|
|
481
|
-
*/
|
|
482
|
-
name: string | undefined;
|
|
483
|
-
/**
|
|
484
|
-
* The distance (in meters) between the snapped point and the input coordinate.
|
|
485
|
-
*/
|
|
486
|
-
distance: number | undefined;
|
|
487
|
-
}
|
|
437
|
+
export type DrivingSide = "left" | "right";
|
|
488
438
|
|
|
489
439
|
/**
|
|
490
|
-
*
|
|
491
|
-
*
|
|
492
|
-
* Note that the name is intentionally a bit generic to allow for expansion of other states.
|
|
493
|
-
* For example, we could conceivably add a \"wrong way\" status in the future.
|
|
440
|
+
* The lane type blocked by the incident.
|
|
494
441
|
*/
|
|
495
|
-
export type
|
|
442
|
+
export type BlockedLane = "left" | "left center" | "left turn lane" | "center" | "right" | "right center" | "right turn lane" | "hov";
|
|
496
443
|
|
|
497
444
|
/**
|
|
498
|
-
*
|
|
445
|
+
* Configurations for built-in route providers.
|
|
499
446
|
*/
|
|
500
|
-
export type
|
|
501
|
-
|
|
502
|
-
export type SerializableStepAdvanceCondition = "Manual" | { DistanceToEndOfStep: { distance: number; minimumHorizontalAccuracy: number } } | { DistanceFromStep: { distance: number; minimumHorizontalAccuracy: number; calculateWhileOffRoute: boolean } } | { DistanceEntryExit: { distanceToEndOfStep: number; distanceAfterEndStep: number; minimumHorizontalAccuracy: number; hasReachedEndOfCurrentStep: boolean } } | { DistanceEntryAndSnappedExit: { distanceToEndOfStep: number; distanceAfterEndStep: number; minimumHorizontalAccuracy: number; hasReachedEndOfCurrentStep: boolean } } | { OrAdvanceConditions: { conditions: SerializableStepAdvanceCondition[] } } | { AndAdvanceConditions: { conditions: SerializableStepAdvanceCondition[] } };
|
|
447
|
+
export type WellKnownRouteProvider = { Valhalla: { endpointUrl: string; profile: string; optionsJson?: string | undefined } } | { GraphHopper: { endpointUrl: string; profile: string; locale: string; voiceUnits: GraphHopperVoiceUnits; optionsJson?: string | undefined } };
|
|
503
448
|
|
|
504
449
|
export type GraphHopperVoiceUnits = "metric" | "imperial";
|
|
505
450
|
|
|
@@ -532,6 +477,32 @@ export interface TripProgress {
|
|
|
532
477
|
durationRemaining: number;
|
|
533
478
|
}
|
|
534
479
|
|
|
480
|
+
/**
|
|
481
|
+
* Controls when a waypoint should be marked as complete.
|
|
482
|
+
*
|
|
483
|
+
* While a route may consist of thousands of points, waypoints are special.
|
|
484
|
+
* A simple trip will have only one waypoint: the final destination.
|
|
485
|
+
* A more complex trip may have several intermediate stops.
|
|
486
|
+
* Just as the navigation state keeps track of which steps remain in the route,
|
|
487
|
+
* it also tracks which waypoints are still remaining.
|
|
488
|
+
*
|
|
489
|
+
* Tracking waypoints enables Ferrostar to reroute users when they stray off the route line.
|
|
490
|
+
* The waypoint advance mode specifies how the framework decides
|
|
491
|
+
* that a waypoint has been visited (and is removed from the list).
|
|
492
|
+
*
|
|
493
|
+
* NOTE: Advancing to the next *step* and advancing to the next *waypoint*
|
|
494
|
+
* are separate processes.
|
|
495
|
+
* This will not normally cause any issues, but keep in mind that
|
|
496
|
+
* manually advancing to the next step does not *necessarily* imply
|
|
497
|
+
* that the waypoint will be marked as complete!
|
|
498
|
+
*/
|
|
499
|
+
export type WaypointAdvanceMode = { WaypointWithinRange: number } | { WaypointAlongAdvancingStep: number };
|
|
500
|
+
|
|
501
|
+
export interface SerializableNavState {
|
|
502
|
+
tripState: TripState;
|
|
503
|
+
stepAdvanceCondition: SerializableStepAdvanceCondition;
|
|
504
|
+
}
|
|
505
|
+
|
|
535
506
|
/**
|
|
536
507
|
* Information pertaining to the user\'s full navigation trip. This includes
|
|
537
508
|
* simple stats like total duration and distance.
|
|
@@ -556,25 +527,9 @@ export interface TripSummary {
|
|
|
556
527
|
}
|
|
557
528
|
|
|
558
529
|
/**
|
|
559
|
-
* Controls
|
|
560
|
-
*
|
|
561
|
-
* While a route may consist of thousands of points, waypoints are special.
|
|
562
|
-
* A simple trip will have only one waypoint: the final destination.
|
|
563
|
-
* A more complex trip may have several intermediate stops.
|
|
564
|
-
* Just as the navigation state keeps track of which steps remain in the route,
|
|
565
|
-
* it also tracks which waypoints are still remaining.
|
|
566
|
-
*
|
|
567
|
-
* Tracking waypoints enables Ferrostar to reroute users when they stray off the route line.
|
|
568
|
-
* The waypoint advance mode specifies how the framework decides
|
|
569
|
-
* that a waypoint has been visited (and is removed from the list).
|
|
570
|
-
*
|
|
571
|
-
* NOTE: Advancing to the next *step* and advancing to the next *waypoint*
|
|
572
|
-
* are separate processes.
|
|
573
|
-
* This will not normally cause any issues, but keep in mind that
|
|
574
|
-
* manually advancing to the next step does not *necessarily* imply
|
|
575
|
-
* that the waypoint will be marked as complete!
|
|
530
|
+
* Controls filtering/post-processing of user course by the [`NavigationController`].
|
|
576
531
|
*/
|
|
577
|
-
export type
|
|
532
|
+
export type CourseFiltering = "SnapToRoute" | "Raw";
|
|
578
533
|
|
|
579
534
|
export interface SerializableNavigationControllerConfig {
|
|
580
535
|
/**
|
|
@@ -607,15 +562,84 @@ export interface SerializableNavigationControllerConfig {
|
|
|
607
562
|
}
|
|
608
563
|
|
|
609
564
|
/**
|
|
610
|
-
* Controls
|
|
565
|
+
* Controls how simulated locations deviate from the actual route line.
|
|
566
|
+
* This simulates real-world GPS behavior where readings often have systematic bias.
|
|
611
567
|
*/
|
|
612
|
-
export type
|
|
568
|
+
export type LocationBias = { Left: number } | { Right: number } | { Random: number } | "None";
|
|
613
569
|
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
570
|
+
/**
|
|
571
|
+
* The current state of the simulation.
|
|
572
|
+
*/
|
|
573
|
+
export interface LocationSimulationState {
|
|
574
|
+
current_location: UserLocation;
|
|
575
|
+
remaining_locations: GeographicCoordinate[];
|
|
576
|
+
bias: LocationBias;
|
|
577
|
+
}
|
|
578
|
+
|
|
579
|
+
export type SimulationError = { PolylineError: { error: string } } | "NotEnoughPoints";
|
|
580
|
+
|
|
581
|
+
/**
|
|
582
|
+
* A set of optional filters to exclude candidate edges based on their attributes.
|
|
583
|
+
*/
|
|
584
|
+
export interface ValhallaLocationSearchFilter {
|
|
585
|
+
/**
|
|
586
|
+
* Whether to exclude roads marked as tunnels.
|
|
587
|
+
*/
|
|
588
|
+
exclude_tunnel?: boolean;
|
|
589
|
+
/**
|
|
590
|
+
* Whether to exclude roads marked as bridges.
|
|
591
|
+
*/
|
|
592
|
+
exclude_bridge?: boolean;
|
|
593
|
+
/**
|
|
594
|
+
* Whether to exclude roads with tolls.
|
|
595
|
+
*/
|
|
596
|
+
exclude_tolls?: boolean;
|
|
597
|
+
/**
|
|
598
|
+
* Whether to exclude ferries.
|
|
599
|
+
*/
|
|
600
|
+
exclude_ferry?: boolean;
|
|
601
|
+
/**
|
|
602
|
+
* Whether to exclude roads marked as ramps.
|
|
603
|
+
*/
|
|
604
|
+
exclude_ramp?: boolean;
|
|
605
|
+
/**
|
|
606
|
+
* Whether to exclude roads marked as closed due to a live traffic closure.
|
|
607
|
+
*/
|
|
608
|
+
exclude_closures?: boolean;
|
|
609
|
+
/**
|
|
610
|
+
* The lowest road class allowed.
|
|
611
|
+
*/
|
|
612
|
+
min_road_class?: ValhallaRoadClass;
|
|
613
|
+
/**
|
|
614
|
+
* The highest road class allowed.
|
|
615
|
+
*/
|
|
616
|
+
max_road_class?: ValhallaRoadClass;
|
|
617
|
+
/**
|
|
618
|
+
* If specified, will only consider edges that are on or traverse the passed floor level.
|
|
619
|
+
* It will set `search_cutoff` to a default value of 300 meters if no cutoff value is passed.
|
|
620
|
+
* Additionally, if a `search_cutoff` is passed, it will be clamped to 1000 meters.
|
|
621
|
+
*/
|
|
622
|
+
level?: number;
|
|
617
623
|
}
|
|
618
624
|
|
|
625
|
+
/**
|
|
626
|
+
* Specifies a preferred side for departing from / arriving at a location.
|
|
627
|
+
*
|
|
628
|
+
* Examples:
|
|
629
|
+
* - Germany drives on the right side of the road. A value of `same` will only allow leaving
|
|
630
|
+
* or arriving at a location such that it is on your right.
|
|
631
|
+
* - Australia drives on the left side of the road. Passing a value of `same` will only allow
|
|
632
|
+
* leaving or arriving at a location such that it is on your left.
|
|
633
|
+
*/
|
|
634
|
+
export type ValhallaWaypointPreferredSide = "same" | "opposite" | "either";
|
|
635
|
+
|
|
636
|
+
/**
|
|
637
|
+
* A road class in the Valhalla taxonomy.
|
|
638
|
+
*
|
|
639
|
+
* These are ordered from highest (fastest travel speed) to lowest.
|
|
640
|
+
*/
|
|
641
|
+
export type ValhallaRoadClass = "motorway" | "trunk" | "primary" | "secondary" | "tertiary" | "unclassified" | "residential" | "service_other";
|
|
642
|
+
|
|
619
643
|
/**
|
|
620
644
|
* Waypoint properties supported by Valhalla servers.
|
|
621
645
|
*
|
|
@@ -715,66 +739,62 @@ export interface ValhallaWaypointProperties {
|
|
|
715
739
|
}
|
|
716
740
|
|
|
717
741
|
/**
|
|
718
|
-
*
|
|
742
|
+
* The event type.
|
|
743
|
+
*
|
|
744
|
+
* For full replayability, we record things like rerouting, and not just location updates.
|
|
719
745
|
*/
|
|
720
|
-
export
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
exclude_bridge?: boolean;
|
|
729
|
-
/**
|
|
730
|
-
* Whether to exclude roads with tolls.
|
|
731
|
-
*/
|
|
732
|
-
exclude_tolls?: boolean;
|
|
733
|
-
/**
|
|
734
|
-
* Whether to exclude ferries.
|
|
735
|
-
*/
|
|
736
|
-
exclude_ferry?: boolean;
|
|
737
|
-
/**
|
|
738
|
-
* Whether to exclude roads marked as ramps.
|
|
739
|
-
*/
|
|
740
|
-
exclude_ramp?: boolean;
|
|
746
|
+
export type NavigationRecordingEventData = { StateUpdate: { trip_state: TripState; step_advance_condition: SerializableStepAdvanceCondition } } | { RouteUpdate: { route: Route } };
|
|
747
|
+
|
|
748
|
+
/**
|
|
749
|
+
* An event that occurs during navigation.
|
|
750
|
+
*
|
|
751
|
+
* This is used for the optional session recording / telemetry.
|
|
752
|
+
*/
|
|
753
|
+
export interface NavigationRecordingEvent {
|
|
741
754
|
/**
|
|
742
|
-
*
|
|
755
|
+
* The timestamp of the event in milliseconds since Jan 1, 1970 UTC.
|
|
743
756
|
*/
|
|
744
|
-
|
|
757
|
+
timestamp: number;
|
|
745
758
|
/**
|
|
746
|
-
*
|
|
759
|
+
* Data associated with the event.
|
|
747
760
|
*/
|
|
748
|
-
|
|
761
|
+
event_data: NavigationRecordingEventData;
|
|
762
|
+
}
|
|
763
|
+
|
|
764
|
+
/**
|
|
765
|
+
* Waypoint properties parsed from an OSRM-compatible server response.
|
|
766
|
+
*
|
|
767
|
+
* NOTE: Some servers (such as Valhalla) may support additional parameters at request time
|
|
768
|
+
* which are _not_ echoed back in the response time.
|
|
769
|
+
* This is unfortunate; PRs upstream would likely be welcomed!
|
|
770
|
+
* Similarly, if your server is OSRM-compatible and returns additional attributes,
|
|
771
|
+
* feel free to open a PR to include these as optional properties.
|
|
772
|
+
*/
|
|
773
|
+
export interface OsrmWaypointProperties {
|
|
749
774
|
/**
|
|
750
|
-
* The
|
|
775
|
+
* The name of the street that the waypoint snapped to.
|
|
751
776
|
*/
|
|
752
|
-
|
|
777
|
+
name: string | undefined;
|
|
753
778
|
/**
|
|
754
|
-
*
|
|
755
|
-
* It will set `search_cutoff` to a default value of 300 meters if no cutoff value is passed.
|
|
756
|
-
* Additionally, if a `search_cutoff` is passed, it will be clamped to 1000 meters.
|
|
779
|
+
* The distance (in meters) between the snapped point and the input coordinate.
|
|
757
780
|
*/
|
|
758
|
-
|
|
781
|
+
distance: number | undefined;
|
|
759
782
|
}
|
|
760
783
|
|
|
761
784
|
/**
|
|
762
|
-
*
|
|
763
|
-
*
|
|
764
|
-
* Examples:
|
|
765
|
-
* - Germany drives on the right side of the road. A value of `same` will only allow leaving
|
|
766
|
-
* or arriving at a location such that it is on your right.
|
|
767
|
-
* - Australia drives on the left side of the road. Passing a value of `same` will only allow
|
|
768
|
-
* leaving or arriving at a location such that it is on your left.
|
|
785
|
+
* Determines if the user has deviated from the expected route.
|
|
769
786
|
*/
|
|
770
|
-
export type
|
|
787
|
+
export type RouteDeviationTracking = "None" | { StaticThreshold: { minimumHorizontalAccuracy: number; maxAcceptableDeviation: number } };
|
|
771
788
|
|
|
772
789
|
/**
|
|
773
|
-
*
|
|
790
|
+
* Status information that describes whether the user is proceeding according to the route or not.
|
|
774
791
|
*
|
|
775
|
-
*
|
|
792
|
+
* Note that the name is intentionally a bit generic to allow for expansion of other states.
|
|
793
|
+
* For example, we could conceivably add a \"wrong way\" status in the future.
|
|
776
794
|
*/
|
|
777
|
-
export type
|
|
795
|
+
export type RouteDeviation = "NoDeviation" | { OffRoute: { deviationFromRouteLine: number } };
|
|
796
|
+
|
|
797
|
+
export type SerializableStepAdvanceCondition = "Manual" | { DistanceToEndOfStep: { distance: number; minimumHorizontalAccuracy: number } } | { DistanceFromStep: { distance: number; minimumHorizontalAccuracy: number; calculateWhileOffRoute: boolean } } | { DistanceEntryExit: { distanceToEndOfStep: number; distanceAfterEndStep: number; minimumHorizontalAccuracy: number; hasReachedEndOfCurrentStep: boolean } } | { DistanceEntryAndSnappedExit: { distanceToEndOfStep: number; distanceAfterEndStep: number; minimumHorizontalAccuracy: number; hasReachedEndOfCurrentStep: boolean } } | { OrAdvanceConditions: { conditions: SerializableStepAdvanceCondition[] } } | { AndAdvanceConditions: { conditions: SerializableStepAdvanceCondition[] } };
|
|
778
798
|
|
|
779
799
|
|
|
780
800
|
export class NavigationController {
|
package/ferrostar_bg.js
CHANGED
|
@@ -745,7 +745,7 @@ export function __wbg_getRandomValues_1c61fac11405ffdc() { return handleError(fu
|
|
|
745
745
|
globalThis.crypto.getRandomValues(getArrayU8FromWasm0(arg0, arg1));
|
|
746
746
|
}, arguments) };
|
|
747
747
|
|
|
748
|
-
export function
|
|
748
|
+
export function __wbg_getRandomValues_9c5c1b115e142bb8() { return handleError(function (arg0, arg1) {
|
|
749
749
|
globalThis.crypto.getRandomValues(getArrayU8FromWasm0(arg0, arg1));
|
|
750
750
|
}, arguments) };
|
|
751
751
|
|
package/ferrostar_bg.wasm
CHANGED
|
Binary file
|