0

I'm having some difficulties to specify Vehicle Type in my request. According to the documentation, it should look like something like this:

var request = {
    origin:start,
    destination:end,
    travelMode: google.maps.DirectionsTravelMode.DRIVING,
    TransitDetails: google.maps.TransitLine.TransitVehicle.VehicleType.BUS
};

But the folowing error shows up every time:

TypeError: google.maps.TransitLine is undefined

I think there's something wrong with my TransitDetails path.. but I can't figure out what exactly...

Kaloyan Kosev
  • 12,483
  • 8
  • 59
  • 90

1 Answers1

0

There is no TransitDetails-option for a directionsRequest.

There is only a TransitOptions-option where you can define departureTime and arrivalTime . The vehicleType is a part of the directionsResponse and is a simple string(e.g. BUS)

Dr.Molle
  • 116,463
  • 16
  • 195
  • 201