DirectionsService A service for calculating a route between two locations. If the class is instantiated, with an external directions provider, it is possible to calculate routes between indoor locations and a location outside the solution or vice-versa.

# new DirectionsService(externalProvider)

Creates an instance of DirectionsService.
Name Type Description
externalProvider mapsindoors.directions.MapboxProvider | mapsindoors.directions.GoogleMapsProvider An external directions provider.


# async getRoute(args) → {DirectionsResult}

Requests a route between the origin and destination with the given parameters.
Name Type Attributes Default Description
args DirectionsRequest
origin LatLngLiteral The coordinates of the origin location. If the location is indoors it should include the floorIndex.
destination LatLngLiteral The coordinates of the destination location. If the location is indoors it should include the floorIndex.
travelMode string <optional>
WALKING Specifies which travel mode to use. Supported travel modes are: DRIVING, BYCYCLING, WALKING, and TRANSIT. TRANSIT is currently only supported by the Google Maps directions provider.
avoidStairs string <optional>
false If true the route is calculated without any stairs if possible.
userRoles Array.<string> <optional>
Deprecated: Specifies which user role ids to use.

# setExternalProvider(provider)

Set an external directions provider.