router.Segment
Note
The constructor of the router.Segment class is hidden, as this class is not intended for autonomous initialization.
Object that describes a segment of the route. A segment is a part of the route from one maneuver to the next. The constructor is not available in the package.full (a standard set of modules). This module is loaded on demand.
Methods
Name |
Returns |
Description |
String |
Returns the direction the route turns at the end of the segment. Possible values:
|
|
getAngle() |
Number |
Checks the angle at which the route turns at the end of the segment. |
Number[][] |
Returns coordinates of a polyline that describes the segment geometry. |
|
String |
Returns the direction of the turn in the form of a localized human-readable string. |
|
String |
Returns a string representation of segment driving time with measurement units, with consideration for traffic. |
|
String |
Returns a string representation of segment length with measurement units. |
|
String |
Returns a string representation of segment driving time with measurement units. |
|
getIndex() |
Integer |
Returns the index of the given segment in the array of all the segments in the path. |
Integer |
Returns the segment driving time in seconds, with consideration for traffic. |
|
Number |
Returns the length of the segment in meters. |
|
Integer |
Returns the index of the point in the path geometry at which the segment ends. |
|
Integer |
Returns the index of the point in the path geometry from which the segment begins. |
|
String |
Returns the name of the street that the segment of the route goes along. |
|
getTime() |
Integer |
Returns the segment driving time in seconds. |
Methods details
getAction
{String} getAction()
Returns the direction the route turns at the end of the segment. Possible values:
- left - Left.
- slight left - Slightly left.
- hard left - Sharp left turn.
- right - Right.
- slight right - Slightly right.
- hard right - Sharp right turn.
- none - Straight.
- back - Turn around.
- enter roundabout - Entrance to a roundabout intersection.
- leave roundabout [N] - Exit from a roundabout intersection. The number N is the number of the turn on the circle. This number can be omitted. For example, "leave roundabout" or "leave roundabout 2".
- merge - Entrance to a highway. Signifies merging with traffic.
- board ferry - Ferry crossing.
getAngle
{Number} getAngle()
Checks the angle at which the route turns at the end of the segment.
Returns the angle of the turn (in degrees).
getCoordinates
{Number[][]} getCoordinates()
Returns coordinates of a polyline that describes the segment geometry.
getHumanAction
{String} getHumanAction()
Returns the direction of the turn in the form of a localized human-readable string.
getHumanJamsTime
{String} getHumanJamsTime()
Returns a string representation of segment driving time with measurement units, with consideration for traffic.
getHumanLength
{String} getHumanLength()
Returns a string representation of segment length with measurement units.
getHumanTime
{String} getHumanTime()
Returns a string representation of segment driving time with measurement units.
getIndex
{Integer} getIndex()
Returns the index of the given segment in the array of all the segments in the path.
getJamsTime
{Integer} getJamsTime()
Returns the segment driving time in seconds, with consideration for traffic.
getLength
{Number} getLength()
Returns the length of the segment in meters.
getPolylineEndIndex
{Integer} getPolylineEndIndex()
Returns the index of the point in the path geometry at which the segment ends.
getPolylineStartIndex
{Integer} getPolylineStartIndex()
Returns the index of the point in the path geometry from which the segment begins.
getStreet
{String} getStreet()
Returns the name of the street that the segment of the route goes along.
getTime
{Integer} getTime()
Returns the segment driving time in seconds.