Fork me on GitHub
Show:

Route

Extends aeris.Collection

Summary

A collection of Waypoint instances

Constructor

aeris.maps.gmaps.route.Route

Syntax

aeris.maps.gmaps.route.Route

(
  • opt_waypoints
  • opt_options
)

Summary

Parameters:

Methods

atOffset

Syntax

atOffset

(
  • waypoint
  • offsetIndex
)
Waypoint|undefined

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.

Parameters:

Returns:

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.

deselectAllExcept

Syntax

deselectAllExcept

(
  • waypoint
)

Summary

Parameters:

distanceTo

Syntax

distanceTo

(
  • waypoint
)
Number

Summary

Calculates the distance to a given waypoint, from the start of the route.

Parameters:

Returns:

ensureHasWaypoint_

Syntax

ensureHasWaypoint_

(
  • waypoint
)
private

Summary

Parameters:

ensurePathsForAllWaypoints_

Syntax

ensurePathsForAllWaypoints_

() private

Summary

Update paths on all waypoint in the route, unless the waypoint already has a path set.

export

Syntax

export

() String

Summary

Exports the route as a JSON string.

Returns:

String:

JSON string representation of route.

getDeselected

Syntax

getDeselected

() Array.<MapObjectInterface>

Summary

getLastWaypoint

Syntax

getLastWaypoint

() Waypoint

Summary

Get the last Waypoint in the Route.

Returns:

getNext

Syntax

getNext

(
  • waypoint
)
Waypoint|undefined

Summary

Returns the waypoint after the specified waypoint. If it's the last waypoint, returns undefined.

Parameters:

Returns:

getPrevious

Syntax

getPrevious

(
  • waypoint
)
Waypoint|undefined

Summary

Returns the waypoint before the specified waypoint. If it's the first waypoint, returns undefined.

Parameters:

Returns:

getSelected

Syntax

getSelected

() Array.<Waypoint>

Summary

Returns all selected waypoints.

Returns:

getWaypoints

Syntax

getWaypoints

() Array.<Waypoint>

Summary

Get the array of waypoints.

Returns:

import

Syntax

import

(
  • jsonStr
  • opt_options
)

Summary

Import a JSON string array of waypoints

Parameters:

  • jsonStr String
  • opt_options Object

    Option to pass to reset.

keepDistanceUpdated_

Syntax

keepDistanceUpdated_

() private

Summary

keepPathsUpdated_

Syntax

keepPathsUpdated_

() private

Summary

movePreviousWaypointToStartOfPath_

Syntax

movePreviousWaypointToStartOfPath_

(
  • waypoint
  • path
)
private

Summary

Parameters:

moveWaypointToStartOfPath_

Syntax

moveWaypointToStartOfPath_

(
  • waypoint
  • path
)
private

Summary

Parameters:

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

updatePathBetween

(
  • origin
  • destination
)
Promise

Summary

Update the path between two waypoints, using a {aeris.maps.gmaps.route.directions.AbstractDirectionsService}

Parameters:

Returns:

Promise:

A Promise to return and update directions.

Properties

cid

Syntax

cid

String

Summary

A unique client id

distance

Syntax

distance

Number

Summary

Distance of route in meters.