com.google.maps

Class DirectionsApiRequest

  • java.lang.Object
    • com.google.maps.DirectionsApiRequest
  • All Implemented Interfaces:
    PendingResult<DirectionsRoute[]>


    public class DirectionsApiRequestextends java.lang.Object
    Request for the Directions API.
    • Method Detail

      • validateRequest

        protected void validateRequest()
      • origin

        public DirectionsApiRequest origin(java.lang.String origin)
        The address or textual latitude/longitude value from which you wish to calculate directions. If you pass an address as a string, the Directions service will geocode the string and convert it to a latitude/longitude coordinate to calculate directions. If you pass coordinates, ensure that no space exists between the latitude and longitude values.
      • destination

        public DirectionsApiRequest destination(java.lang.String destination)
        The address or textual latitude/longitude value from which you wish to calculate directions. If you pass an address as a string, the Directions service will geocode the string and convert it to a latitude/longitude coordinate to calculate directions. If you pass coordinates, ensure that no space exists between the latitude and longitude values.
      • mode

        public DirectionsApiRequest mode(TravelMode mode)
        Specifies the mode of transport to use when calculating directions. The mode defaults to driving if left unspecified. If you set the mode to TRANSIT you must also specify either a departureTime or an arrivalTime.
        Parameters:
        mode - The travel mode to request directions for.
      • region

        public DirectionsApiRequest region(java.lang.String region)
        Parameters:
        region - The region code, specified as a ccTLD ("top-level domain") two-character value.
      • arrivalTime

        public DirectionsApiRequest arrivalTime(org.joda.time.ReadableInstant time)
        Set the arrival time for a Transit directions request.
        Parameters:
        time - The arrival time to calculate directions for.
      • departureTime

        public DirectionsApiRequest departureTime(org.joda.time.ReadableInstant time)
        Set the departure time for a transit or driving directions request. If both departure time and traffic model are not provided, then "now" is assumed. If traffic model is supplied, then departure time must be specified.
        Parameters:
        time - The departure time to calculate directions for.
      • waypoints

        public DirectionsApiRequest waypoints(java.lang.String... waypoints)
        Specifies a list of waypoints. Waypoints alter a route by routing it through the specified location(s). A waypoint is specified as either a latitude/longitude coordinate or as an address which will be geocoded. Waypoints are only supported for driving, walking and bicycling directions.

        For more information on waypoints, see Using Waypoints in Routes.

      • optimizeWaypoints

        public DirectionsApiRequest optimizeWaypoints(boolean optimize)
        Allow the Directions service to optimize the provided route by rearranging the waypoints in a more efficient order.
      • alternatives

        public DirectionsApiRequest alternatives(boolean alternateRoutes)
        If set to true, specifies that the Directions service may provide more than one route alternative in the response. Note that providing route alternatives may increase the response time from the server.
      • transitMode

        public DirectionsApiRequest transitMode(TransitMode... transitModes)
        Specifies one or more preferred modes of transit. This parameter may only be specified for requests where the mode is transit.
      • transitRoutingPreference

        public DirectionsApiRequest transitRoutingPreference(TransitRoutingPreference pref)
        Specifies preferences for transit requests. Using this parameter, you can bias the options returned, rather than accepting the default best route chosen by the API.
      • trafficModel

        public DirectionsApiRequest trafficModel(TrafficModel trafficModel)
        Specifies the traffic model to use when requesting future driving directions. Once set, you must specify a departure time.
      • await

        public final T await()              throws java.lang.Exception
        Description copied from interface: PendingResult
        Performs the request synchronously.
        Specified by:
        await in interface PendingResult<T>
        Returns:
        The result.
        Throws:
        java.lang.Exception
      • awaitIgnoreError

        public final T awaitIgnoreError()
        Description copied from interface: PendingResult
        Performs the request synchronously, ignoring exceptions while performing the request and errors returned by the server.
        Specified by:
        awaitIgnoreError in interface PendingResult<T>
        Returns:
        The result, or null if there was any error or exception ignored.
      • cancel

        public final void cancel()
        Description copied from interface: PendingResult
        Attempt to cancel the request.
        Specified by:
        cancel in interface PendingResult<T>
      • param

        protected A param(java.lang.String key,                  java.lang.String val)
      • param

        protected A param(java.lang.String key,                  com.google.maps.internal.StringJoin.UrlValue val)
      • params

        protected java.util.Map<java.lang.String,java.lang.String> params()
      • language

        public final A language(java.lang.String language)
        The language in which to return results. Note that we often update supported languages so this list may not be exhaustive.
        Parameters:
        language - The language code, e.g. "en-AU" or "es"
        See Also:
        List of supported domain languages
      • channel

        public A channel(java.lang.String channel)
        A channel to pass with the request. channel is used by Google Maps API for Work users to be able to track usage across different applications with the same clientID. See: https://developers.google.com/maps/documentation/business/clientside/quota
        Parameters:
        channel - String to pass with the request for analytics


NOTHING
NOTHING
Add the Maven Dependecy to your project: maven dependecy for com.amazonaws : aws-java-sdk : 1.3.14