RouteLineColorResources
Contains colors an other values used to determine the appearance of the route line.
The congestion range is to be used if when making a route request you use DirectionCriteria.ANNOTATION_CONGESTION_NUMERIC
annotation. The congestion values obtained with this annotation in the route response would be in the range 0..100, 0 being the minimum and 100 being the maximum congestion values. Unknown
congestion values will be represented as null
RouteLineColorResources defines 4 ranges:
lowCongestionRange: default value spans from 0..39
moderateCongestionRange: default value spans from 40..59
heavyCongestionRange: default value spans from 60..79
severeCongestionRange: default value spans from 80..100 You can specify your own ranges for all of the above using the RouteLineColorResources.Builder. If the ranges overlap, the RouteLineColorResources.Builder.build would fail and throw IllegalStateException. You also need to make sure that all values from 0..100 are covered using these four ranges, else any missing number would be treated as unknown congestion. For ex, if you define the range as follows:
lowCongestionRange: 0..39
moderateCongestionRange: 50..59
heavyCongestionRange: 60..79
severeCongestionRange: 80..100 If the route response contains a congestion number 45, it would be treated as
unknown
because it doesn't exist in any of the ranges specified.
A note on visualizing route line colors: The route line is made up of several stacked line layers. The top most line layer is the traffic line followed by the main route line beneath it. By default both lines have the same width so the traffic line obscures the main line. Also the default route line color and the color used for unknown and low traffic congestion is the same.
Be mindful of this if you change the default route line color because if the traffic data in the route is unknown the route line will appear as having the unknown traffic color rather than the default route line color. In this case consider also changing the unknown/low traffic color to match the default route line color or setting the traffic congestion color(s) to something like Color.Transparent if it fits your use case.
Parameters
the range for low congestion traffic.
the range for low congestion traffic.
the range for low congestion traffic.
the range for low congestion traffic.
the default color of the route line
the color used for representing low traffic congestion
the color used for representing moderate traffic congestion
the color used for representing heavy traffic congestion
the color used for representing severe traffic congestion
the color used for representing unknown traffic congestion
the color used for the route closure line
the color used for representing low traffic congestion on inactive legs of the route
the color used for representing moderate traffic congestion on inactive legs of the route
the color used for representing heavy traffic congestion on inactive legs of the route
the color used for representing severe traffic congestion on inactive legs of the route
the color used for representing unknown traffic congestion on inactive legs of the route
the color used for the route closure line on inactive legs of the route
the color for the restricted road indicator(s)
the color for the restricted road indicator(s) on inactive legs of the route
the default color used for alternative route lines
the color used for representing low traffic congestion on alternative routes
the color used for representing moderate traffic congestion on alternative routes
the color used for representing heavy traffic congestion on alternative routes
the color used for representing severe traffic congestion on alternative routes
the color used for representing unknown traffic congestion on alternative routes
the color for the restricted road indicator(s) for alternative routes.
the color used for the alternative route closure line(s)
the color of the section of route line behind the puck representing the section of the route traveled
the color of the casing section of route line behind the puck representing the section of the route traveled. By default the casing line is beneath the route line and gives the appearance of a border
the color used for the route casing line which is positioned below the route line giving the line the appearance of a boarder
the color used for the alternative route casing line(s) which is positioned below the route line giving the line the appearance of a boarder
the color used for casing of route legs hat aren't currently being navigated.
the color used for route legs that aren't currently being navigated.