Skip to Content

SdkLegRoute

class SdkLegRoute(val rawDistance: RoutingDistance, val rawDuration: RoutingDuration, val endAddress: String?, val endLocation: SdkLatLngDTO, val startAddress: String?, val startLocation: SdkLatLngDTO, val steps: List<SdkStepRoute>, val customLastStep: SdkStepRoute?, val unwrappedDistance: Int = rawDistance.value.toInt(), val unwrappedDuration: Int = rawDuration.value.toInt())

Represents a single leg of a route, grouping consecutive SdkStepRoute instances that connect two waypoints.

A leg is the intermediate grouping in the route hierarchy: an SdkRoute contains one or more legs, and each leg contains one or more steps. Most routes produced by the Lazarillo API have a single leg unless the route passes through explicit waypoints.

The leg also provides a lazily-computed sections property that groups steps by their floor/building context. Sections are used by the map rendering layer to paint route segments on a per-floor basis, so only the portion of the route relevant to the currently displayed floor is visible.

See also

SdkRoute
SdkStepRoute
SdkRouteSection

Constructors

SdkLegRouteconstructor(rawDistance: RoutingDistance, rawDuration: RoutingDuration, endAddress: String ?, endLocation: SdkLatLngDTO, startAddress: String ?, startLocation: SdkLatLngDTO, steps: List <SdkStepRoute>, customLastStep: SdkStepRoute?, unwrappedDistance: Int  = rawDistance.value.toInt(), unwrappedDuration: Int  = rawDuration.value.toInt())

Properties

customLastStep

val customLastStep: SdkStepRoute?

Types: SdkStepRoute

An optional custom final step provided by the backend, used to deliver a specific arrival instruction instead of the default “Routing finished”.

endAddress

val endAddress: String?

Human-readable address at the end of this leg, or null if unavailable.

endLocation

val endLocation: SdkLatLngDTO

Coordinates of the leg’s destination as a SdkLatLngDTO.

rawDistance

val rawDistance: RoutingDistance

Types: RoutingDistance

Total distance of this leg as a RoutingDistance (in meters).

rawDuration

val rawDuration: RoutingDuration

Types: RoutingDuration

Total estimated duration of this leg as a RoutingDuration (in seconds).

sections

val sections: List<SdkRouteSection>

Types: SdkRouteSection

The sections will be a collection of steps that will be painted by the map at the same time. The sections also will be ordered by the order of the steps.

startAddress

val startAddress: String?

Human-readable address at the start of this leg, or null if unavailable.

startLocation

val startLocation: SdkLatLngDTO

Coordinates of the leg’s origin as a SdkLatLngDTO.

steps

val steps: List<SdkStepRoute>

Types: SdkStepRoute

Ordered list of navigation steps composing this leg.

unwrappedDistance

val unwrappedDistance: Int

Convenience integer representation of rawDistance in meters.

unwrappedDuration

val unwrappedDuration: Int

Convenience integer representation of rawDuration in seconds.

Functions

getAllSteps

fun getAllSteps(): List<SdkStepRoute>

Types: SdkStepRoute

Last updated on