Class YMKMasstransitRoutePainter

Makes it easy to paint a ColoredPolylineMapObject using the colors for traffic on the route.

Do this in two steps: 1. Initialize the painter. Set the traffic jam style you want and the route from which the painter will take the traffic info. 2. Choose any subpolyline of the route's geometry and pass it to the painter along with the ColoredPolylineMapObject you wish 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 will correspond to the set route's geometry, or the painter will crash.

Instance Methods

- resetWithRoute:

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

- setJamStyleWithStyle:

Sets the current style.

- updatePolylineWithPolyline:subpolyline:

Sets a new geometry and colors for a polyline.

Method Detail

-resetWithRoute:

- (void)resetWithRoute:(nonnull YMKMasstransitRoute *)route 

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

-setJamStyleWithStyle:

- (void)setJamStyleWithStyle:(nonnull YMKMasstransitJamStyle *)style 

Sets the current style.

-updatePolylineWithPolyline:subpolyline:

- (void)updatePolylineWithPolyline:(nonnull YMKColoredPolylineMapObject *)polyline
                       subpolyline:(nonnull YMKSubpolyline *)subpolyline 

Sets a new geometry and colors for a polyline.

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