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
# 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 |