Class

DirectionsService

mapsindoors.services.DirectionsService(externalProvider)

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.

Constructor

# new DirectionsService(externalProvider)

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

Methods

# async getRoute(args) → {DirectionsResult}

Requests a route between the origin and destination with the given parameters.
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>
Specifies which user roles to use.

# setExternalProvider(provider)

Set an external directions provider.
Parameters:
Name Type Description
provider mapsindoors.directions.GoogleMapsProvider | mapsindoors.directions.MapboxProvider