MPDirectionsRenderer

class MPDirectionsRenderer(mapControl: MapControl)

This allows for an easy way to display a route on the MapsIndoors map. Each leg of the route can be shown individually and can be navigated by manipulating the selected leg index. Various customization options are available to adjust the polyline styling and camera behavior.

Constructors

Link copied to clipboard
constructor(mapControl: MapControl)

Types

Link copied to clipboard
object Companion

Functions

Link copied to clipboard
fun clear()

Clears the route from the map

Link copied to clipboard
fun finishGuidance(@FloatRange(from = 0.0, to = 100.0) usagePercentage: Double? = null)

Reports that the user has finished with the current route.

Link copied to clipboard

Returns the effective directions renderer config: the runtime override merged over the solution-served config, or null when neither is set.

Link copied to clipboard

Returns the options most recently applied via setOptions, or null if only the individual (deprecated) setters have been used.

Link copied to clipboard

Gets the currently selected leg's floor index.

Link copied to clipboard

Checks whether the route leg buttons are enabled or disabled

Link copied to clipboard
fun nextLeg()

Selects the next leg if possible. Once the last leg is reached, further use of this method is idempotent

Link copied to clipboard

Selects the previous leg if possible. Once the first leg is reached, further use of this method is idempotent

Link copied to clipboard
fun selectLegIndex(legIndex: Int)

Manually set the selected leg index, on the set route. This may throw an exception if the resulting internal state is invalid (parsed index is out of bounds)

Link copied to clipboard
fun setAnimatedPolyline(animated: Boolean, repeating: Boolean, durationMs: Int)

Enable/Disable the polyline animation, when displaying a route element on the map

Link copied to clipboard

Set the duration of camera animations (ms). If a duration < 0 then camera animations are disabled, and the camera will move instantly. Default is 1000 ms

Link copied to clipboard

Set the fit mode of the camera, when displaying route elements on the map. The camera may be aligned to north, aligned with the first step, aligned from start point to end point.

Link copied to clipboard
fun setCameraViewTilt(@FloatRange(from = 0.0, to = 90.0) tilt: Float)

Set the camera tilt. The camera may be set in a tilting position, when displaying route elements on the map. Default is 0

Link copied to clipboard

Applies a directions renderer route-styling config at runtime. The runtime config takes precedence over the solution-served config — field by field for line and halo, and whole-block for every other section. If a route is already displayed it is re-styled in place.

Link copied to clipboard

Set the default icon for route stops

Link copied to clipboard
fun setLabel(labelProperties: MPDirectionsLabel)

Overrides the default label for middle steps in a route.

Link copied to clipboard

Set a listener, which will be invoked when a new leg has been selected

Link copied to clipboard

Apply a set of style and behaviour options to the renderer.

Link copied to clipboard
fun setPolylineColors(foreground: Int, background: Int)

Set the color of the displayed polyline

Link copied to clipboard
fun setRoute(route: MPRoute)

Set a route to be rendered. This also resets the selected leg and step indices to 0.

Link copied to clipboard

Enable/Disable the route end/start buttons from showing on the route.

Link copied to clipboard

If set, we will show labels and icons from nearby Locations as additional contextual information about the end positions of the rendered route segment. Set this to null if you want to turn off this feature again.