setRoute

fun setRoute(route: MPRoute, icons: Map<Int, MPRouteStopIconProvider>? = null, onCameraEvent: MPCameraEventListener? = null)

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

Parameters

route
  • Route

icons
  • Zero based indexed map with icons to use for the route stops. The indexes are the natural occurring order of the stops. So if optimized use MPRoute.getOrderedStopIndexes to know the order of the stops.

onCameraEvent
  • Notified once the camera has stopped framing the route's first leg, or null to not be notified. See MPDirectionsRenderer for when and how it is called

Throws

If the route has no legs and the SDK is in MPDebugLog.enableDeveloperMode. onCameraEvent is then not called