Google Maps API v3 – How to specify “VehicleType”-Collection of common programming errors
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…
-
There is no
TransitDetails
-option for adirectionsRequest
.There is only a
TransitOptions
-option where you can definedepartureTime
andarrivalTime
. ThevehicleType
is a part of thedirectionsResponse
and is a simple string(e.g.BUS
)
Originally posted 2013-11-09 21:39:09.