gmaps
gmaps copied to clipboard
Add TransitOption as an argument in directions_layer
https://developers.google.com/maps/documentation/javascript/distancematrix
For Transit:
{
arrivalTime: Date,
departureTime: Date,
modes: [transitMode1, transitMode2]
routingPreference: TransitRoutePreference
}
For Driving:
{
origins: [{lat: 55.93, lng: -3.118}, 'Greenwich, England'],
destinations: ['Stockholm, Sweden', {lat: 50.087, lng: 14.421}],
travelMode: 'DRIVING',
drivingOptions: {
departureTime: new Date(Date.now() + N), // for the time N milliseconds from now.
trafficModel: 'optimistic'
}
}
I agree that that would be a nice addition. PRs welcome!