Class

DirectionsRenderer

mapsindoors.directions.DirectionsRenderer(options)

Constructor

# new DirectionsRenderer(options)

Creates an instance of DirectionsRenderer.
Parameters:
Name Type Attributes Default Description
options mapsindoors.directions.DirectionsRendererOptions
mapsIndoors mapsindoors.MapsIndoors MapsIndoors instance.
fitBounds boolean <optional>
true When fitBounds is set to true, the map's viewport will be fitted to the bounds of the rendered route.
fitBoundsPadding number | Padding <optional>
Adds a padding to the viewport when it is fitted to the to the bounds of the rendered route.
animation object <optional>
DefaultRouteAnimation Animation class for animating the route. This can be diabled by setting the animation to `null`
strokeColor string <optional>
Sets the color that the route will be displayed with. The color property is specified a css color value. See https://developer.mozilla.org/en-US/docs/Web/CSS/color_value
strokeOpacity number <optional>
Sets the opacity of the route. The opacity property is specified as a value between 0 and 1. See https://developer.mozilla.org/en-US/docs/Web/CSS/opacity
strokeWeight number <optional>
Sets the weight of the route in pixels.
visible boolean <optional>
true Sets the initial visibility of the route.
defaultRouteStopIconProvider RouteStopIconProvider <optional>
The default icon provider for route stop icons.
Example
const directionsRenderer = new mapsindoors.directions.DirectionsRenderer(...);

Methods

# getAnimation() → {object}

Gets the animation for the route.
object

# getLegIndex()

Returns the index of the leg currently being displayed on the map.

# getRoute() → {DirectionsResult}

Gets the current DirectionsResult.

# getStepIndex()

Returns the index of the step currently being displayed on the map. It returns -1 if no step is selected.

# getVisible() → {boolean}

Returns the current visibility of the route on the map.
boolean

# nextLeg()

Display next leg of the route on the map.

# nextStep()

Display next step of the route on the map.

# previousLeg()

Displays previous leg of the route on the map.

# previousStep()

Displays previous step of the route on the map.

# setAnimation(animation)

Sets the animation for the route.
Parameters:
Name Type Description
animation object

# setLegIndex(index)

Sets the index which leg of the route to display on the map.
Parameters:
Name Type Description
index number

# setOptions(options)

Sets the DirectionsRendererOptions used for rendering the route.
Parameters:
Name Type Description
options DirectionsRendererOptions

# async setRoute(route, stopConfigsopt)

Sets the DirectiyonsResult to be rendered on the map.
Parameters:
Name Type Attributes Description
route DirectionsResult
stopConfigs Map:.<number:, RouteStopConfig:> <optional>
A map of RouteStopConfig objects. The key is the index of the stop in the route.

# setStepIndex(stepIndex, legIndexopt)

Sets the index which leg of the route to display on the map.
Parameters:
Name Type Attributes Description
stepIndex number
legIndex number <optional>

# setVisible(visible)

Sets the visibility of the route on the map.
Parameters:
Name Type Description
visible boolean