DirectionsRequestOptions Object

You can set options for how to calculate the route by passing an object containing direction request options to the setRequestOptions method of the DirectionsManager.

Properties

Name Type Description
distanceUnit DistanceUnit The unit to use when displaying direction distances. The default value is based on the specified culture.
maxRoutes number The number of routes to calculate. If the routeMode is;

  • Driving, up to 3 routes
  • Walking, only 1 route is supported
  • Transit, up to 6 routes

Default: 3
routeAvoidance RouteAvoidance[] The features to avoid when calculating the route. Default: none
routeDraggable boolean A boolean indicating whether the route line on the map can be dragged with the mouse cursor. Default: true

Truck based routes currently do not support being dragged.
routeIndex number If multiple routes are returned, the index of the route and directions to display.
routeMode RouteMode The type of directions to calculate. Default: driving
routeOptimization RouteOptimization The optimization setting for the route calculation. Default: shortestTime
time Date The time to use when calculating the route. If this property is set to null, the current time is used. This option only affects driving and transit routes.
timeType TimeTypes The type of the time specified. Default: departure

This option only affects transit routes, driving routes are always based on departure time.
vehicleSpec VehicleSpec Specifies the vehicle attributes to use when calculating a truck route.