メインコンテンツまでスキップ

Choose an approach

The Mapbox Navigation SDK provides different ways to create a turn-by-turn navigation experience. Various approaches have their own benefits and limitations. This guide will walk you through the options and provide some guidance on how to get started with each.

Drop-in UI

If the need of your application is to build a turn-by-turn experience using UI components delivered with the Mapbox Navigation SDK, you can leverage the NavigationView which offers a configured view to add to your application. Drop-In UI is a navigation layout which handles all stages of navigation and facilitates integration using few lines of code. The framework gives you enough customization options to keep your branding, and replace standalone Navigation UI components with custom made ones to support the unique needs of your use case.

check Benefits:

  • Broad set of customizable options
  • Ability to replace UI components with your custom views
  • Inject custom views within specified constraints in the layout
  • Less effort to integrate a fully working navigation experience
  • Ability to inject MapView you have already been displaying elsewhere in your application

close Limitations:

  • Limited option to pick and choose components
  • Limited option to change the positioning of the UI components

Add the dependency

dependencies {
implementation "com.mapbox.navigation:ui-dropin:2.20.2"
}

The NavigationView class extends the Android View class. NavigationView is like the Maps SDK's MapView class for creating a map and customizing it. The difference is that the navigation functionality is already built in and does not have to be added via the core Navigation SDK.

EXAMPLE
Add a complete turn-by-turn experience

Render a complete turn-by-turn experience using NavigationView.

Collection of standalone components

If you want to build a completely customizable turn-by-turn experience, you can use the Navigation SDK's standalone Core and UI components on top of the Maps SDK for Android's MapView. This approach may be appropriate if you'd like to define a custom business logic to get data or the need for more granular control on the look and appearance of the UI. For example, you could use the Core and UI components to define a custom behavior for requesting and showing alternative routes or control camera transitions.

check Benefits:

  • Completely customizable
  • Ability to pick and choose the components relevant for your application

close Limitations:

  • No out-of-the-box solution
  • Layout composition and state transitions are manual
  • More effort to integrate a fully working navigation experience

Build a collection of components

dependencies {
implementation "com.mapbox.navigation:android:2.20.2"
}

The interplay of the Maps SDK's MapView and the navigation logic that's provided by the Navigation SDK's MapboxNavigation class, creates the most customizable approach to turn-by-turn navigation experiences. This combination brings together the MapView class, which allows for embedding highly customizable maps, and the full flexibility of the MapboxNavigation class. This allows you to customize every detail of the navigation experience without having to build it completely from scratch (using Mapbox APIs directly).

EXAMPLE
Add a complete turn-by-turn experience

Render a complete turn-by-turn experience using all relevant Navigation SDK APIs and pre-built UI components.

この{Type}は役に立ちましたか?