Class DirectionsApi


  • public class DirectionsApi
    extends java.lang.Object
    The Google Directions API is a service that calculates directions between locations using an HTTP request. You can search for directions for several modes of transportation, include transit, driving, walking, or cycling. Directions may specify origins, destinations, and waypoints, either as text strings (e.g. "Chicago, IL" or "Darwin, NT, Australia") or as latitude/longitude coordinates. The Directions API can return multi-part directions using a series of waypoints.

    See the Directions API Developer's Guide for more information.

    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static DirectionsApiRequest getDirections​(GeoApiContext context, java.lang.String origin, java.lang.String destination)
      Creates a new DirectionsApiRequest between the given origin and destination, using the defaults for all other options.
      static DirectionsApiRequest newRequest​(GeoApiContext context)
      Creates a new DirectionsApiRequest using the given context, with all attributes at their default values.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • newRequest

        public static DirectionsApiRequest newRequest​(GeoApiContext context)
        Creates a new DirectionsApiRequest using the given context, with all attributes at their default values.
        Parameters:
        context - Context that the DirectionsApiRequest will be executed against
        Returns:
        A newly constructed DirectionsApiRequest between the given points.
      • getDirections

        public static DirectionsApiRequest getDirections​(GeoApiContext context,
                                                         java.lang.String origin,
                                                         java.lang.String destination)
        Creates a new DirectionsApiRequest between the given origin and destination, using the defaults for all other options.
        Parameters:
        context - Context that the DirectionsApiRequest will be executed against
        origin - Origin address as text
        destination - Destination address as text
        Returns:
        A newly constructed DirectionsApiRequest between the given points.