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, optimizeopt) → {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. | |
stops |
Array:.<LatLngLiteral:>
|
<optional> |
List of waypoints to visit on the way. If a stop is indoors it must include the floorIndex. | |
optimize |
boolean
|
<optional> |
false | If true the service will try to optimize the route by visiting the stops in the order that minimizes the total travel time. |
# setExternalProvider(provider)
Set an external directions provider.
Parameters:
Name | Type | Description |
---|---|---|
provider |
mapsindoors.directions.GoogleMapsProvider
|
mapsindoors.directions.MapboxProvider
|