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.
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>
Sets the initial visibility of the route.
Example
const directionsRenderer = new mapsindoors.directions.DirectionsRenderer(...);

Methods

# getLegIndex()

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

# getRoute() → {DirectionsResult}

Gets the current DirectionsResult.

# getVisible() → {boolean}

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

# nextLeg()

Display next leg of the route on the map.

# previousLeg()

Displays previous leg of the route on the map.

# 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

# setRoute(route)

Sets the DirectionsResult to be rendered on the map.
Parameters:
Name Type Description
route DirectionsResult

# setVisible(visible)

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