Class GSWaypoint
Represents a single waypoint within a route.
| Constructor Attributes | Constructor Name and Description |
|---|---|
|
GSWaypoint(coordinate, options)
Creates a new |
| Property Attributes | Property Name and Description |
|---|---|
|
The label to use for this waypoint when referenced in driving instructions
|
|
|
The type of waypoint, either 'stop' or 'via'.
|
| Method Attributes | Method Name and Description |
|---|---|
|
getIndex()
Get the index of this waypoint in the route
|
|
|
setCoordinate(coordinate)
Set the coordinate for this waypoint
|
|
|
Get a GeoJSON representation of the waypoint
|
| Event Attributes | Event Name and Description |
|---|---|
|
routeViaWaypointInserted(route, insertedWaypoint, waypoint)
|
|
|
routeViaWaypointMoved(route, waypoint)
|
Class Detail
GSWaypoint(coordinate, options)
Creates a new GSWaypoint which can then be added to a GSRoute.
var startWaypoint = new GSWaypoint(new GSPoint(2665166, 6493817), {
label: 'GeoSmart',
type: 'stop'
}));
- Parameters:
- {GSPoint} coordinate
- the coordinate for the waypoint
- {Object} options Optional
- an object literal specifying options for this waypoint. The following options may be specified:
- {String} options.label
- the label to use for this waypoint when referenced in driving instructions
- {String} options.type
- the type for this waypoint. Either "
stop" or "via". Default is "stop"- "
stop" waypoints delimit individual legs in the route - "
via" waypoints only influence the calculated path of the route between the "stop" waypoints in the route
- "
Property Detail
{string}
label
The label to use for this waypoint when referenced in driving instructions
{string}
type
The type of waypoint, either 'stop' or 'via'.
Method Detail
{int}
getIndex()
Get the index of this waypoint in the route
- Returns:
- {int} the index of the waypoint
setCoordinate(coordinate)
Set the coordinate for this waypoint
- Parameters:
- {GSPoint} coordinate
- the new coordinate for this waypoint
{Object}
toGeoJsonObj()
Get a GeoJSON representation of the waypoint
- Returns:
- {Object} the GeoJSON object representation
Event Detail
routeViaWaypointInserted(route, insertedWaypoint, waypoint)
- Parameters:
- {GSRoute} route
- a reference to the route the via waypoint belongs to
- {GSWaypoint} insertedWaypoint
- the new via waypoint that was inserted
- {GSWaypoint} waypoint
- the waypoint the new via waypoint was inserted after
routeViaWaypointMoved(route, waypoint)
- Parameters:
- {GSRoute} route
- a reference to the route the via waypoint belongs to
- {GSWaypoint} waypoint
- the via waypoint that was moved