DrivingOptions class
Specifies the desired time of departure and/or desired assumption
of time in traffic calculation for non-transit TravelMode.
May contain the following fields:
- 
departureTime- specifies the desired time of departure. The departure time may be specified in two cases:
- 
For requests where the travel mode is transit: You can optionally specify one ofdepartureTimeorarrivalTime. If neither time is specified, thedepartureTimedefaults to now (that is, the departure time defaults to the current time).
- 
For requests where the travel mode is driving: You can specify thedepartureTimeto receive a route and trip duration (response field:durationInTraffic) that take traffic conditions into account. ThedepartureTimemust be set to the current time or some time in the future. It cannot be in the past.
Note: If departure time is not specified, choice of route and duration are based on road network and average time-independent traffic conditions. Results for a given request may vary over time due to changes in the road network, updated average traffic conditions, and the distributed nature of the service. Results may also vary between nearly-equivalent routes at any time or frequency.
- trafficModel- specifies the assumptions to use when calculating time in traffic. This setting affects the value returned in the- durationInTrafficfield in the response, which contains the predicted time in traffic based on historical averages. The- trafficModelparameter may only be specified for driving directions where the request includes a- departureTime.
The available values for this parameter are:
- bestGuess(default) indicates that the returned- durationInTrafficshould be the best estimate of travel time given what is known about both historical traffic conditions and live traffic. Live traffic becomes more important the closer the- departureTimeis to now.
- pessimisticindicates that the returned- durationInTrafficshould be longer than the actual travel time on most days, though occasional days with particularly bad traffic conditions may exceedthis value.
- optimisticindicates that the returned- durationInTrafficshould be shorter than the actual travel time on most days, though occasional days with particularly good traffic conditions may be faster than this value.
The default value of bestGuess will give the most useful
predictions for the vast majority of use cases. It is possible
the bestGuess travel time prediction may be shorter than
optimistic, or alternatively, longer than pessimistic, due to
the way the bestGuess prediction model integrates live traffic
information.
Constructors
- DrivingOptions({DateTime? departureTime, TrafficModel? trafficModel})
- 
          
            const
Properties
- departureTime → DateTime?
- 
  Specifies the desired time of departure. The departure time
may be specified in two cases:
  final
- hashCode → int
- 
  The hash code for this object.
  no setterinherited
- runtimeType → Type
- 
  A representation of the runtime type of the object.
  no setterinherited
- trafficModel → TrafficModel?
- 
  Specifies the assumptions to use when calculating time in traffic.
This setting affects the value returned in the durationInTrafficfield in the response, which contains the predicted time in traffic based on historical averages. ThetrafficModelparameter may only be specified for driving directions where the request includes adepartureTime.final
Methods
- 
  noSuchMethod(Invocation invocation) → dynamic 
- 
  Invoked when a nonexistent method or property is accessed.
  inherited
- 
  toString() → String 
- 
  A string representation of this object.
  override
Operators
- 
  operator ==(Object other) → bool 
- 
  The equality operator.
  inherited