Class GSRouteLeg
Represents a leg of journey. Provides a set of directions instructions and summary information for the leg.
| Constructor Attributes | Constructor Name and Description |
|---|---|
|
GSRouteLeg(route, instructionDefinitions, distance, time, startLabel, stopLabel, index)
Creates a new |
| Method Attributes | Method Name and Description |
|---|---|
|
Get the distance travelled for this route leg
|
|
|
Get the driving instructions for this route leg
|
|
|
getTime()
Get the time for this route leg
|
Class Detail
GSRouteLeg(route, instructionDefinitions, distance, time, startLabel, stopLabel, index)
Creates a new GSRouteLeg object.
You should not need to instantiate GSRouteLeg objects yourself - GSRoute will instantiate GSRouteLeg objects for you automatically. See GSRoute#getLegs
- Parameters:
- {GSRoute} route
- the route that this route leg belongs to
- {Array} instructionDefinitions
- an array of instruction definitions
- {int} distance
- the distance in metres
- {int} time
- the duration in minutes
- {String} startLabel
- the label to use for the "start" instruction for this leg
- {String} stopLabel
- the label to use for the "stop" instruction for this leg
- {int} index
- the index of this leg within the route
Method Detail
{int}
getDistance()
Get the distance travelled for this route leg
- Returns:
- {int} the distance travelled for this route leg in metres
{GSRouteInstruction[]}
getInstructions()
Get the driving instructions for this route leg
- Returns:
- {GSRouteInstruction[]} an array of GSRouteInstruction objects
{float}
getTime()
Get the time for this route leg
- Returns:
- {float} the time for this route leg in minutes