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.
avoidHighwayTypes Array:.<string:> <optional>
Specifies which highway types to avoid in the route. If a highway type is specified in the `avoidHighwayTypes` array, the service will try to calculate a route that minimizes the use of these types of highways.
excludeHighwayTypes Array:.<string:> <optional>
Specifies which highway types to exclude from the route. If a highway type is specified in the `excludeHighwayTypes` array, the service will calculate a route that does not include these types of highways at all.
userRoles Array:.<string:> <optional>
Deprecated: Specifies which user role ids to use.

# setExternalProvider(provider)

Set an external directions provider.
Parameters: