Route
Summary
A collection of Waypoint instances
Constructor
Item Index
Methods
- atOffset
- deselectAll
- deselectAllExcept
- distanceTo
- ensureHasWaypoint_
- ensurePathsForAllWaypoints_
- export
- getDeselected
- getLastWaypoint
- getNext
- getPrevious
- getSelected
- getWaypoints
- import
- keepDistanceUpdated_
- keepPathsUpdated_
- movePreviousWaypointToStartOfPath_
- moveWaypointToStartOfPath_
- recalculateAndUpdateDistance
- selectAll
- updatePathBetween
Methods
atOffset
Syntax
Summary
Returns a waypoint at an index distance from the specified waypoint.
For example: this.atOffset(waypoint, -2);
would return the waypoint which is two befeore the specified waypoint.
If there's no waypoint at the requested index, returns undefined.
deselectAll
Syntax
deselectAll
-
opt_options
Summary
Deselects all of the route's waypoints.
Parameters:
-
opt_options
Object=Whether to trigger Waypoint#deselect and Route#waypoint:deselect events. Defaults to true.
distanceTo
Syntax
Summary
Calculates the distance to a given waypoint, from the start of the route.
Parameters:
-
waypoint
Waypoint
Returns:
ensureHasWaypoint_
Syntax
ensureHasWaypoint_
-
waypoint
Summary
Parameters:
-
waypoint
Model
ensurePathsForAllWaypoints_
Syntax
ensurePathsForAllWaypoints_
()
private
Summary
Update paths on all waypoint in the route, unless the waypoint already has a path set.
export
Syntax
Summary
Exports the route as a JSON string.
Returns:
JSON string representation of route.
getDeselected
Syntax
Summary
Returns:
getLastWaypoint
Syntax
Summary
Get the last Waypoint in the Route.
Returns:
getNext
Syntax
Summary
Returns the waypoint after the specified waypoint. If it's the last waypoint, returns undefined.
Parameters:
-
waypoint
Waypoint
getPrevious
Syntax
Summary
Returns the waypoint before the specified waypoint. If it's the first waypoint, returns undefined.
Parameters:
-
waypoint
Waypoint
getSelected
Syntax
Summary
Returns all selected waypoints.
getWaypoints
Syntax
Summary
Get the array of waypoints.
import
Syntax
import
-
jsonStr
-
opt_options
Summary
Import a JSON string array of waypoints
keepDistanceUpdated_
Syntax
keepDistanceUpdated_
()
private
Summary
keepPathsUpdated_
Syntax
keepPathsUpdated_
()
private
Summary
movePreviousWaypointToStartOfPath_
Syntax
movePreviousWaypointToStartOfPath_
-
waypoint
-
path
Summary
moveWaypointToStartOfPath_
Syntax
moveWaypointToStartOfPath_
-
waypoint
-
path
Summary
recalculateAndUpdateDistance
Syntax
recalculateAndUpdateDistance
()
Summary
Recalculate the total distance of all waypoints in the route.
selectAll
Syntax
selectAll
-
opt_options
Summary
Selects all of the route's waypoints.
Parameters:
-
opt_options
Object=Whether to trigger Waypoint#select and Route#waypoint:select events. Defaults to true.
updatePathBetween
Syntax
Summary
Update the path between two waypoints, using a {aeris.maps.gmaps.route.directions.AbstractDirectionsService}
Returns:
A Promise to return and update directions.