How do I change the style of the map in a navigation view?

  android, mapbox, navigation, styles

I am implementing the mapbox maps and the mapbox navigation by using these imports:

    implementation 'com.mapbox.mapboxsdk:mapbox-android-sdk:9.5.0'
    implementation 'com.mapbox.mapboxsdk:mapbox-android-navigation-ui:0.42.6'

I have map with a self made map style, from which I select a destination location and launch the navigation activity.

button.setOnClickListener(new View.OnClickListener() {
                    @Override
                    public void onClick(View v) {
                        boolean simulateRoute = false;
                        NavigationLauncherOptions options = NavigationLauncherOptions.builder()
                                .directionsRoute(currentRoute)
                                .shouldSimulateRoute(simulateRoute)
                                .build();
                        // Call this method with Context from within an Activity
                        NavigationLauncher.startNavigation(NavigationActivity.this, options);
                    }
                });

The navigation activity displays a map that has a style that does not match the one I used in the map that I used to start the navigation activity. How can I change the style of the map in the navigation view to match the one I used for the map that selected the destination.

Source: Android Questions

LEAVE A COMMENT