mapbox / mapbox-navigation-android

Mapbox Navigation SDK for Android
https://docs.mapbox.com/android/navigation/overview/
Other
622 stars 319 forks source link

The routeLineTraveledColor does not work in version v3 sdk #7865

Open heyuejin2empty opened 2 months ago

heyuejin2empty commented 2 months ago
    val mapboxRouteLineApiOptions = MapboxRouteLineApiOptions.Builder().build()
    val mapboxRouteLineViewOptions = MapboxRouteLineViewOptions.Builder(this)
        .routeLineBelowLayerId("road-label-navigation")
        .routeLineColorResources(RouteLineColorResources.Builder()
            .routeLineTraveledColor(Color.RED)
            .routeLineTraveledCasingColor(Color.GREEN)
            .routeCasingColor(Color.BLUE)
            .routeClosureColor(Color.YELLOW)
            .routeDefaultColor(Color.GRAY)
            .build()).build()
    routeLineAPI = MapboxRouteLineApi(mapboxRouteLineApiOptions)
    routeLineView = MapboxRouteLineView(mapboxRouteLineViewOptions)
    val routeArrowOptions = RouteArrowOptions.Builder(this)
        .build()
    routeArrowView = MapboxRouteArrowView(routeArrowOptions)

I use the dependent version: implementation "com.mapbox.navigationcore:navigation:3.3.1" implementation "com.mapbox.navigationcore:copilot:3.3.1" implementation "com.mapbox.navigationcore:ui-maps:3.3.1" implementation "com.mapbox.navigationcore:voice:3.3.1" implementation "com.mapbox.navigationcore:tripdata:3.3.1" implementation "com.mapbox.navigationcore:android:3.3.1" implementation "com.mapbox.navigationcore:ui-components:3.3.1"

wirthandras commented 1 month ago

@heyuejin2empty I am using version 2.19, in my app the withVanishingRouteLineEnabled(true) function was required for this color change