Car route

Car route is a sequence of roads and crossroads that connect them. The route exists only while the car that created it is inside the CarMoveTo block.

Route API

double getLength() - Returns an approximate length of the car route in pixels. The length of a road here is calculated along the central guideline, while the length of an intersection is calculated as an average length of all lane connectors possible for route. If the route begins and/or ends with a parking lot or a bus stop, only half the length of that markup element will be counted towards the route length.

double getLength(LengthUnits units) - Returns an approximate length of a car route in the given length units. The length of a road here is calculated along the central guideline, while the length of an intersection is calculated as an average length of all lane connectors possible for route. If the route begins and/or ends with a parking lot or a bus stop, only half the length of that markup element will be counted towards the route length.

Parameter:
units - a constant that describes a length unit

Intersection getIntersections() - Returns an ordered list of intersections that are included in the route. The obtained list is unmodifiable.

Road getRoads() - Returns an ordered list of the roads that are included in the route. The obtained list is unmodifiable.


Related topics

Car API