google-maps-documentation

DirectionsRequest interface

google.maps.DirectionsRequest interface

A directions query to be sent to the DirectionsService.

Properties
avoidFerries
Type:  boolean optional
If true, instructs the Directions service to avoid ferries where possible. Optional.
avoidHighways
Type:  boolean optional
If true, instructs the Directions service to avoid highways where possible. Optional.
avoidTolls
Type:  boolean optional
If true, instructs the Directions service to avoid toll roads where possible. Optional.
destination
Type:  string|LatLng|Place|LatLngLiteral
Location of destination. This can be specified as either a string to be geocoded, or a LatLng, or a Place. Required.
drivingOptions
Type:  DrivingOptions optional
Settings that apply only to requests where travelMode is DRIVING. This object will have no effect for other travel modes.
optimizeWaypoints
Type:  boolean optional
If set to true, the DirectionsService will attempt to re-order the supplied intermediate waypoints to minimize overall cost of the route. If waypoints are optimized, inspect DirectionsRoute.waypoint_order in the response to determine the new ordering.
origin
Type:  string|LatLng|Place|LatLngLiteral
Location of origin. This can be specified as either a string to be geocoded, or a LatLng, or a Place. Required.
provideRouteAlternatives
Type:  boolean optional
Whether or not route alternatives should be provided. Optional.
region
Type:  string optional
Region code used as a bias for geocoding requests. Optional.
transitOptions
Type:  TransitOptions optional
Settings that apply only to requests where travelMode is TRANSIT. This object will have no effect for other travel modes.
travelMode
Type:  TravelMode
Type of routing requested. Required.
unitSystem
Type:  UnitSystem optional
Preferred unit system to use when displaying distance. Defaults to the unit system used in the country of origin.
waypoints
Type:  Array<DirectionsWaypoint> optional
Array of intermediate waypoints. Directions are calculated from the origin to the destination by way of each waypoint in this array. See the developer's guide for the maximum number of waypoints allowed. Waypoints are not supported for transit directions. Optional.