TrafficOverrideOptions
class TrafficOverrideOptions
Traffic override related config
In order to update traffic it is necessary to request routes with specific RouteOptions. At a minimum the following options are necessary:
val routeOptions = RouteOptions.builder()
.baseUrl(Constants.BASE_API_URL)
.user(Constants.MAPBOX_USER)
.profile(DirectionsCriteria.PROFILE_DRIVING_TRAFFIC)
.overview(DirectionsCriteria.OVERVIEW_FULL)
.steps(true)
.annotationsList(
listOf(
DirectionsCriteria.ANNOTATION_CONGESTION_NUMERIC,
DirectionsCriteria.ANNOTATION_MAXSPEED,
DirectionsCriteria.ANNOTATION_DISTANCE,
)
)
.coordinatesList(listOf(origin, destination))
.build()
Content copied to clipboard
A good starting point might be RouteOptions.Builder.applyDefaultNavigationOptions() which will include the options above.
Parameters
isEnabled
defines if traffic override is enabled
highSpeedThresholdInKmPerHour
defines what speed should be treated as a high speed
lowCongestionRange
the range for low congestion traffic
moderateCongestionRange
the range for moderate congestion traffic
heavyCongestionRange
the range for heavy congestion traffic
severeCongestionRange
the range for severe congestion traffic
Types
Link copied to clipboard
class Builder
Build a new TrafficOverrideOptions