Skip to main content

Display route instructions

|

Instructions are represented as arrows on the map and can be displayed by using MapView.centerOnRouteInstruction(instruction, zoomLevel, xy, animation, viewAngle). To obtain a route's instructions, see the Route structure section. The following example iterates through all instructions of a route and displays each one by centering:

    val routeInstruction = route.instructions[0]
mapView.centerOnRouteInstruction(
instruction = routeInstruction,
zoomLevel = 75,
xy = null, // Use default center position
animation = Animation(EAnimation.Linear, 1000), // 1 second animation
viewAngle = Double.MAX_VALUE // Use default view angle
)
Turn right arrow instruction

The route instruction arrow is automatically cleared when a new route instruction is centered on or when the route is cleared using mapView.hideRoutes().