Skip to content

Better Route Navigation SDK

Early stage

The Navigation SDK is still under active development, and we don't yet have an active customer running it in production. Beyond your own integration effort, budget extra time to trial it together with us; treat this as early access rather than a drop-in integration.

Add turn-by-turn navigation, optimised for the last-mile delivery use case, on top of the sequence you get from the Better Route API, with on- and offline capability and rich maps. This is one of two optional further extension options for a Deep Integration; it works independently of Address Formatter Kotlin.

Route SDK header
Route SDK flow

Implementation example

The SDK API surface shown below is still under validation and may change.

To show a map, initialise GeoMapApi():

val mutableCameraSource =
    remember(geoMapApi) {
        val mutableCameraSource =
            geoMapApi.MutableCameraSource(
                cameraBehavior = CameraBehavior.FIXED,
                cameraPosition = cameraPosition,
            )
    }

val mutableInteractionSource = MutableInteractionSource()

geoMapApi.GeoMapView(
    modifier = modifier,
    mapStyle = null,
    mutableCameraSource = mutableCameraSource,
    disabledGestures = emptyList(),
    mutableInteractionSource = mutableInteractionSource,
) {
    geoMapApi.MapMarkers(mapMarkers = listOf(marker), mutableInteractionSource) {}
}

To start turn-by-turn navigation, initialise navigatorMapApi():

val routeWaypoints = mutableListOf<NavigationModelWaypoint>()
var navigationState by remember { mutableStateOf(NavigationState.RUNNING) }

navigatorMapApi.Navigation(
    sequence = NavigationModelSequence(routeWaypoints.toList()),
    navigationState = navigationState,
    isSimulated = false,
    maneuverOptions = ManeuverNotificationOptions(languageCode = LanguageCode.EN_US),
    maneuverEvent = {},
    voicePromptEvent = {},
    mutableCameraSource = mutableCameraSource,
    mapInteractionSource = mutableInteractionSource,
    onDestinationReached = {},
    onStopOverReached = {},
    routeDurationInMillis = {},
)