Class YMKMasstransitRoutePainter

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.

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 methods of a polyline: - setGeometry - setColors - setPaletteColor