Class

DirectionsRenderer

DirectionsRenderer(options)

A simple directions renderer for displaying a route on the map.

Constructor

new DirectionsRenderer(options)

Parameters:
Name Type Description
options DirectionsRendererOptions
Example
let directionsRenderer = new mapsindoors.DirectionsRenderer({
     map: googleMap,
     mapsindoors: mapsIndoors,
     strokeColor: '#4caf50',
     strokeWeight: 4,
     strokeOpacity: 1
});

directionsRenderer.nextLeg();

Extends

  • google.maps.MVCObject

Methods

getMap() → {google.maps.Map}

Gets the current google map.
google.maps.Map

getRoute() → {DirectionsResult}

Gets the current DirectionsResult.

getVisible() → {boolean}

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

nextLeg()

Displays 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