Interface RoutePainter

com.yandex.mapkit.transport.masstransit

public interface RoutePainter

Makes it easy to paint ColoredPolylineMapObject in route traffic colors.

Do this in two steps: 1. Initialize the painter. Set the traffic style you want and the route for the painter to use to get info about traffic intensity. 2. Choose any subpolyline of the route's geometry and give it to the painter along with the ColoredPolylineMapObject you want to paint. The painter will set the geometry of the map object to that of the chosen subpolyline and assign colors for any of its segments.

You can assign other routes to the painter. But make sure that the subpolyline you give to the painter afterwards corresponds to the set route's geometry, otherwise the painter will crash.

Methods

void reset(@NonNull Route route)

Resets colors according to the current traffic intensity on the route.

void setJamStyle(@NonNull JamStyle style)

Sets the current style.

void updatePolyline(@NonNull ColoredPolylineMapObject polyline, @NonNull Subpolyline subpolyline)

Sets a new geometry and colors for a polyline.

Method Detail

reset

public void reset (@NonNull Route route)

Resets colors according to the current traffic intensity on the route.

setJamStyle

public void setJamStyle (@NonNull JamStyle style)

Sets the current style.

updatePolyline

public void updatePolyline (@NonNull ColoredPolylineMapObject polyline, @NonNull Subpolyline subpolyline)

Sets a new geometry and colors for a polyline.

The method calls only the following methods of a polyline: - setGeometry - setColors - setPaletteColor