mapbox / mapbox/mapbox-navigation-android

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

Open
#7,946 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Kotlin
Stars
651
Forks
321
PR merge metrics
No merged PRs in 30d

Description

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

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the DropInNavigationView API, its customizeViewOptions configuration, and the startFreeDrive entry point shown in the issue. Review how MapboxNavigationViewportDataSource and followingZoomPropertyOverride are intended to interact with Free Drive, then determine whether a supported public zoom control exists and document the expected behavior or API gap.

Written by the indexing model from the issue text.

Assessment

Tech stack
android, kotlin
Domain
mobile
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Quiet
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.