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.

distanceUnitDistanceUnitThe unit to use when displaying direction distances. The default value is based on the specified culture.
maxRoutesnumberThe 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
routeAvoidanceRouteAvoidance[]The features to avoid when calculating the route. Default: none
routeDraggablebooleanA boolean indicating whether the route line on the map can be dragged with the mouse cursor. Default: true
routeIndexnumberIf multiple routes are returned, the index of the route and directions to display.
routeModeRouteModeThe type of directions to calculate. Default: driving
routeOptimizationRouteOptimizationThe optimization setting for the route calculation. Default: shortestTime
timeDateThe 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.
timeTypeTimeTypesThe type of the time specified. Default: departure

This option only affects transit routes, driving routes are always based on departure time.