public DistanceMatrixApiRequest mode ( TravelMode mode ) { if ( TravelMode . DRIVING . equals ( mode ) || TravelMode . WALKING . equals ( mode ) || TravelMode . BICYCLING . equals ( mode ) || TravelMode . TRANSIT . equals ( mode ) ) { return param ( "mode" , mode ) ; } throw new IllegalArgumentException ( "Distance Matrix API travel modes must be Driving, Transit, Walking or Bicycling" ) ; }
Specifies the mode of transport to use when calculating directions .