Renders a MPRoute on the map.

Export

Hierarchy

  • MPDirectionsRenderer

Constructors

Properties

_defaultRouteStopIcon?: RouteStopIconConfig
eventEmitter?: NativeEventEmitter

Event handler.

onLegSelectedSub?: EmitterSubscription

Listener for leg selection events.

Accessors

Methods

  • Signals that guidance on the current route has finished, either because the user arrived or because they ended navigation.

    Has no effect when no route is set, or when guidance on the current route has already finished. clear finishes guidance implicitly, so there is no need to call both.

    Parameters

    • Optional usagePercentage: number

      How much of the route was travelled, from 0 to 100. Values outside that range are clamped. Omit it to let the SDK derive the figure from the route's own progress.

    Returns Promise<void>

    Async

  • Selects the next leg if possible.

    Has no effect if the last leg is selected.

    Returns Promise<void>

    Async

  • Selects the previous leg if possible.

    Has no effect if the first leg is selected.

    Returns Promise<void>

    Async

  • Manually set the selected leg index on the route.

    This may reject if the resulting internal state is invalid (parsed index is out of bounds).

    Parameters

    • legIndex: number

    Returns Promise<void>

    Async

  • Set the duration of camera animations in ms.

    If the duration < 0 then camera animations are disabled, and the camera will move instantly.

    The value is 1000 ms by default

    Parameters

    • durationMs: number

    Returns Promise<void>

    Async

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

    This is used for when the forward/back markers are selected on the map.

    Parameters

    Returns Promise<void>

    Async

  • Set the styling and camera options of the rendered route.

    Applies immediately, restyling an already rendered route in place. Every option resolves on its own, in this order: the value set here, then the solution level default configured in the CMS, then the SDK's built-in default. Options left unset are therefore inherited rather than reset.

    Parameters

    Returns Promise<void>

    Async

  • Set the colors of the route polyline.

    Colors are given as hex strings (e.g. "#3071D9").

    Parameters

    • foregroundColor: string

      the primary color (animated polyline)

    • backgroundColor: string

      the secondary color (static polyline)

    Returns Promise<void>

    Deprecated

    Use setOptions with animatedOverlayColor (foreground) and strokeColor (background) instead.

    Async

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

    Parameters

    • Optional route: MPRoute
    • Optional stopIcons: Map<number, RouteStopIconConfig> = null
    • Optional legIndex: number = 0

      Overwrites the starting leg index, when rendering the route

    Returns Promise<void>

    Async

  • Enable/Disable the route end/start label buttons from showing on the route. Default is true

    Parameters

    • show: boolean

    Returns Promise<void>

    Async

Generated using TypeDoc