I would like to be able to get transit directions through the JS api, that is limited to a single vehicle type (e.g. Bus). This functionality is available on maps.google.com, but how do i submit the vehicle type as part of the DirectionsRequest?.
Using the code below will provide routes via Bus, Train
google.maps.DirectionsTravelMode.TRANSIT
But if i want to restrict only to Train, how do i do it?
Best Answer
google.maps.VehicleType object specification
Possible values for vehicle types. These values are specifed as strings, i.e. 'BUS' or 'TRAIN'.
https://developers.google.com/maps/documentation/javascript/3.exp/reference#VehicleType