Google Maps API Adds New Transit Directions and Fares

Android developers can now create robust direction-enabled applications with new Google Maps API enhancements. Writing for 9to5google.com, Joe Rossignol highlights major takeaways from Google's new release.

Transit direction information has been added to the Google Maps Distance Matrix API. Previously, this component was only available in the Google Maps Directions API

Where available, the transit directions for both APIs will now also include fare information (similar to what the Google Maps Android app already does). This means that routes can be programmatically created that minimize travel cost. 

Also similar the the Google Maps app, directions using the Distance Matrix API will now include transit options such as train, tram, subway, and bus. Lastly, within Direction API requests, specifying a timestamp has become optional with "departure_time=now" being the default time request.

The exact changelog released from Google:

  • 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.

As developers experiment with these new enhancements, the end result for Android users will likely be more apps enabled with comprehensive transit direction information.

Be sure to read the next Transportation article: Multinational Taxi firm Takes On Uber With API

Original Article

Google Maps APIs gain improved transit directions for Android developers

 

Comments