Optionalconfiguration: Partial<MapLibreGlDirectionsConfiguration>Protected_Protected_Protected_A publicly-available abort-controller that allows to manually abort an ongoing routing-request.
Only exists (!== undefined) when there's an ongoing routing-request.
Allows user to switch to alternative routes while in non-interactive mode. Only takes effect when hoverable is
true.
ProtectedbuildProtected
Creates a
Optionalproperties: Record<string, unknown>ProtectedbuildProtected
Builds the routing-request method, URL and payload based on the provided configuration and the waypoints' coordinates.
OptionalwaypointsBearings: ([number, number] | undefined)[]ProtectedbuildProtected
Creates route lines from the server response.
Each route line is an array of legs, where each leg is an array of segments. A segment is a
ProtectedbuildProtected
Creates a $
Protected ReadonlyconfigurationProtectedcurrentProtecteddepartProtecteddragProtectedhighlightedProtectedhighlightedProtectedhoverpointProtectedlastProtectedliveProtected ReadonlymapProtected OptionalnoProtectedonProtectedonProtectedonProtectedonProtectedonProtectedprofilesProtectedrefreshProtectedroutelinesProtectedselectedProtectedsnappointsProtected OptionalwaypointProtected OptionalwaypointAllows hover effects in non-interactive mode. Can be set to true while interactive is false for the features
to be highlighted when hovered over by the user. Does nothing when interactive is true.
The interactivity state of the instance. When true, the user is allowed to interact with the features drawn on
the map and to add waypoints by clicking the map. Automatically set to false whenever there's an ongoing
routing request.
ProtectedsnaplinesProtectedsnappointsReturns all the waypoints' coordinates in the order they appear.
Returns all the waypoints' bearings values or an empty array if the bearings configuration option is not
enabled.
Sets the waypoints' bearings values. Does not produce any effect in case the bearings configuration option is
disabled.
ProtectedwaypointsProtected_Optionalindex: numberOptionaloriginalEvent: MapMouseEvent | MapTouchEventProtected_OptionaloriginalEvent: MapMouseEvent | MapTouchEventAdds a waypoint at the specified coordinates to the map and re-fetches the routes.
The coordinates at which the waypoint should be added
Optionalindex: number
The index the waypoint should be inserted at. If omitted, the waypoint is inserted at the end
Resolved after the routing request has finished
ProtectedassignClears the map from all the instance's traces: waypoints, snappoints, routes, etc.
ProtecteddeRemoves all the added MapLibreGlDirections-specific layers and sources. Must be called manually before
de-initializing the instance.
ProtecteddrawProtectedfetchProtectedfetchProtectedfireFires an event and notifies all listeners.
The event object to fire.
false if the event's preventDefault() method was called, true otherwise.
ProtectedinitProtectedliveUn-registers an event listener.
this for method chaining.
Registers an event listener.
this for method chaining.
Registers an event listener to be invoked only once.
this for method chaining.
ProtectedonProtectedonProtectedonProtectedonProtectedonRemoves a waypoint and its related snappoint by the waypoint's index from the map and re-fetches the routes.
The index of the waypoint to remove
Resolved after the routing request has finished
Replaces all the waypoints with the specified ones and re-fetches the routes.
The coordinates at which the waypoints should be added
Profiles for fetching directions between waypoints.
Resolved after the routing request has finished
The main class responsible for all the user interaction and for the routing itself.