Today we released a set of improvements to transit directions in the Google Maps APIs. If you use transit directions in your app, you can now show fare info and give your users the same mode and routing options as the Google Maps Android app.


blog01.pngblog02.png

Specifically, the changes are as follows:
  • Transit is now available in the Google Maps Distance Matrix API and the Distance Matrix service in the Google Maps JavaScript API v3. Previously it was only available in the Google Maps Directions API and the Directions service.
  • Transit directions will now return fare information where available, same as the Google Maps Android app. In the Distance Matrix API, this enables developers to find routes that minimize either the travel time or the fare.
  • Transit directions now accept transit options, same as the Google Maps Android app. Options include mode preferences (transit_mode=train|tram|subway|bus) as well as routing preferences (transit_routing_preference=less_walking or fewer_transfers).
  • Developers can now set departure_time=now in Directions API queries instead of specifying a timestamp. The departure_time parameter is now optional and will default to departure_time=now if not specified.

These changes are also available in the Directions service and Distance Matrix service in the Google Maps JavaScript API v3.

Posted by Elena Kelareva, Product Manager, Google Maps APIs