Skip to content

existe uma API pública para controlar o zoom do Free Drive no NavigationView Drop-in #7946

@edieldk-collab

Description

@edieldk-collab

dropInNavigationView.customizeViewOptions {
mapStyleUriDay = "mapbox://styles/mapbox/navigation-day-v1"
showManeuver = true
showSpeedLimit = false
showRoadName = false
showTripProgress = false
showActionButtons = false
showEndNavigationButton = false
showStartNavigationButton = false
showRoutePreviewButton = false
showInfoPanelInFreeDrive = false
}

// Tenta definir zoom 16.5 no modo Free Drive
dropInNavigationView.post {
try {
MapboxNavigationApp.current()?.let { nav ->
dropInNavigationView.api.startFreeDrive()

        // Tenta criar um viewportDataSource e sobrescrever o zoom
        val viewportDataSource = com.mapbox.navigation.ui.maps.camera.data.MapboxNavigationViewportDataSource(
            dropInNavigationView.retrieveMapboxMap() ?: return@let
        )
        viewportDataSource.options.followingFrameOptions.zoomUpdatesAllowed = false
        viewportDataSource.followingZoomPropertyOverride(16.5)
        viewportDataSource.evaluate()
    }
} catch (e: Exception) {
    Log.e("MainActivity", "Erro ao configurar zoom Free Drive: ${e.message}")
}

}

tentei varias formulas

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions