Exemple #1
0
    /// <summary>
    /// Calculates directions between locations.\n
    /// You can search for directions for several modes of transportation, include transit, driving, walking or cycling. \n
    /// Directions may specify origins, destinations as latitude/longitude coordinates.
    /// </summary>
    /// <param name="origin">The address from which you wish to calculate directions.</param>
    /// <param name="destination">The address from which you wish to calculate directions.</param>
    /// <param name="mode">Specifies the mode of transport to use when calculating directions.</param>
    /// <param name="waypoints">
    /// Specifies an array of waypoints. \n
    /// Waypoints alter a route by routing it through the specified location(s). \n
    /// A waypoint is specified as either a latitude/longitude coordinate or as an address which will be geocoded. \n
    /// Waypoints are only supported for driving, walking and bicycling directions.
    /// </param>
    /// <param name="alternatives">
    /// If set to true, specifies that the Directions service may provide more than one route alternative in the response. \n
    /// Note that providing route alternatives may increase the response time from the server.
    /// </param>
    /// <param name="avoid">Indicates that the calculated route(s) should avoid the indicated features.</param>
    /// <param name="units">
    /// Specifies the unit system to use when displaying results.\n
    /// Note: this unit system setting only affects the text displayed within distance fields. The distance fields also contain values which are always expressed in meters.
    /// </param>
    /// <param name="region">Specifies the region code, specified as a ccTLD ("top-level domain") two-character value.</param>
    /// <param name="departure_time">
    /// Specifies the desired time of departure. \n
    /// You can specify the time as an integer in seconds since midnight, January 1, 1970 UTC. \n
    /// Alternatively, you can specify a value of now, which sets the departure time to the current time (correct to the nearest second).\n
    /// The departure time may be specified in two cases:\n
    /// For transit directions: You can optionally specify one of departure_time or arrival_time. If neither time is specified, the departure_time defaults to now (that is, the departure time defaults to the current time).\n
    /// For driving directions: Google Maps API for Work customers can specify the departure_time to receive trip duration considering current traffic conditions. The departure_time must be set to within a few minutes of the current time.
    /// </param>
    /// <param name="arrival_time">
    /// Specifies the desired time of arrival for transit directions, in seconds since midnight, January 1, 1970 UTC. \n
    /// You can specify either departure_time or arrival_time, but not both. \n
    /// Note that arrival_time must be specified as an integer.
    /// </param>
    /// <param name="language">
    /// Specifies the language in which to return results.\n
    /// Note that we often update supported languages so this list may not be exhaustive.\n
    /// If language is not supplied, the service will attempt to use the native language of the domain from which the request is sent.
    /// </param>
    /// <returns>Instance of the search query.</returns>
    public static OnlineMapsFindDirectionAdvanced Find(
        string origin,
        string destination,
        OnlineMapsFindDirectionMode mode = OnlineMapsFindDirectionMode.driving,
        string[] waypoints = null,
        bool alternatives  = false,
        OnlineMapsFindDirectionAvoid avoid = OnlineMapsFindDirectionAvoid.none,
        OnlineMapsFindDirectionUnits units = OnlineMapsFindDirectionUnits.metric,
        string region       = null,
        long departure_time = -1,
        long arrival_time   = -1,
        string language     = null)
    {
        OnlineMapsFindDirectionAdvanced query = new OnlineMapsFindDirectionAdvanced(new Params(origin, destination)
        {
            mode           = mode,
            waypoints      = waypoints != null? waypoints.Cast <object>().ToArray(): null,
            alternatives   = alternatives,
            avoid          = avoid,
            units          = units,
            region         = region,
            departure_time = departure_time > 0? (object)departure_time: null,
            arrival_time   = arrival_time > 0? (long?)arrival_time: null,
            language       = language
        });

        OnlineMaps.instance.AddGoogleAPIQuery(query);
        return(query);
    }
Exemple #2
0
    public static OnlineMapsFindDirectionAdvanced Find(Params p)
    {
        OnlineMapsFindDirectionAdvanced query = new OnlineMapsFindDirectionAdvanced(p);

        OnlineMaps.instance.AddGoogleAPIQuery(query);
        return(query);
    }
Exemple #3
0
    /// <summary>
    /// Calculates directions between locations.\n
    /// You can search for directions for several modes of transportation, include transit, driving, walking or cycling. \n
    /// Directions may specify origins, destinations as latitude/longitude coordinates.
    /// </summary>
    /// <param name="origin">The address from which you wish to calculate directions.</param>
    /// <param name="destination">The address from which you wish to calculate directions.</param>
    /// <param name="mode">Specifies the mode of transport to use when calculating directions.</param>
    /// <param name="waypoints">
    /// Specifies an array of waypoints. \n
    /// Waypoints alter a route by routing it through the specified location(s). \n
    /// A waypoint is specified as either a latitude/longitude coordinate or as an address which will be geocoded. \n
    /// Waypoints are only supported for driving, walking and bicycling directions.
    /// </param>
    /// <param name="alternatives">
    /// If set to true, specifies that the Directions service may provide more than one route alternative in the response. \n
    /// Note that providing route alternatives may increase the response time from the server.
    /// </param>
    /// <param name="avoid">Indicates that the calculated route(s) should avoid the indicated features.</param>
    /// <param name="units">
    /// Specifies the unit system to use when displaying results.\n
    /// Note: this unit system setting only affects the text displayed within distance fields. The distance fields also contain values which are always expressed in meters.
    /// </param>
    /// <param name="region">Specifies the region code, specified as a ccTLD ("top-level domain") two-character value.</param>
    /// <param name="departure_time">
    /// Specifies the desired time of departure. \n
    /// You can specify the time as an integer in seconds since midnight, January 1, 1970 UTC. \n
    /// Alternatively, you can specify a value of now, which sets the departure time to the current time (correct to the nearest second).\n
    /// The departure time may be specified in two cases:\n
    /// For transit directions: You can optionally specify one of departure_time or arrival_time. If neither time is specified, the departure_time defaults to now (that is, the departure time defaults to the current time).\n
    /// For driving directions: Google Maps API for Work customers can specify the departure_time to receive trip duration considering current traffic conditions. The departure_time must be set to within a few minutes of the current time.
    /// </param>
    /// <param name="arrival_time">
    /// Specifies the desired time of arrival for transit directions, in seconds since midnight, January 1, 1970 UTC. \n
    /// You can specify either departure_time or arrival_time, but not both. \n
    /// Note that arrival_time must be specified as an integer.
    /// </param>
    /// <param name="language">
    /// Specifies the language in which to return results.\n
    /// Note that we often update supported languages so this list may not be exhaustive.\n
    /// If language is not supplied, the service will attempt to use the native language of the domain from which the request is sent.
    /// </param>
    /// <returns>Instance of the search query.</returns>
    public static OnlineMapsFindDirectionAdvanced Find(
        string origin,
        string destination,
        OnlineMapsFindDirectionMode mode = OnlineMapsFindDirectionMode.driving,
        string[] waypoints = null,
        bool alternatives  = false,
        OnlineMapsFindDirectionAvoid avoid = OnlineMapsFindDirectionAvoid.none,
        OnlineMapsFindDirectionUnits units = OnlineMapsFindDirectionUnits.metric,
        string region       = null,
        long departure_time = -1,
        long arrival_time   = -1,
        string language     = null)
    {
        OnlineMapsFindDirectionAdvanced query = new OnlineMapsFindDirectionAdvanced(origin, destination, mode, waypoints, alternatives, avoid, units, region, departure_time, arrival_time, language);

        OnlineMaps.instance.AddGoogleAPIQuery(query);
        return(query);
    }
 /// <summary>
 /// Calculates directions between locations.\n
 /// You can search for directions for several modes of transportation, include transit, driving, walking or cycling. \n
 /// Directions may specify origins, destinations as latitude/longitude coordinates.
 /// </summary>
 /// <param name="origin">The address from which you wish to calculate directions.</param>
 /// <param name="destination">The address from which you wish to calculate directions.</param>
 /// <param name="mode">Specifies the mode of transport to use when calculating directions.</param>
 /// <param name="waypoints">
 /// Specifies an array of waypoints. \n
 /// Waypoints alter a route by routing it through the specified location(s). \n
 /// A waypoint is specified as either a latitude/longitude coordinate or as an address which will be geocoded. \n
 /// Waypoints are only supported for driving, walking and bicycling directions.
 /// </param>
 /// <param name="alternatives">
 /// If set to true, specifies that the Directions service may provide more than one route alternative in the response. \n
 /// Note that providing route alternatives may increase the response time from the server.
 /// </param>
 /// <param name="avoid">Indicates that the calculated route(s) should avoid the indicated features.</param>
 /// <param name="units">
 /// Specifies the unit system to use when displaying results.\n
 /// Note: this unit system setting only affects the text displayed within distance fields. The distance fields also contain values which are always expressed in meters.
 /// </param>
 /// <param name="region">Specifies the region code, specified as a ccTLD ("top-level domain") two-character value.</param>
 /// <param name="departure_time">
 /// Specifies the desired time of departure. \n
 /// You can specify the time as an integer in seconds since midnight, January 1, 1970 UTC. \n
 /// Alternatively, you can specify a value of now, which sets the departure time to the current time (correct to the nearest second).\n
 /// The departure time may be specified in two cases:\n
 /// For transit directions: You can optionally specify one of departure_time or arrival_time. If neither time is specified, the departure_time defaults to now (that is, the departure time defaults to the current time).\n
 /// For driving directions: Google Maps API for Work customers can specify the departure_time to receive trip duration considering current traffic conditions. The departure_time must be set to within a few minutes of the current time.
 /// </param>
 /// <param name="arrival_time">
 /// Specifies the desired time of arrival for transit directions, in seconds since midnight, January 1, 1970 UTC. \n
 /// You can specify either departure_time or arrival_time, but not both. \n
 /// Note that arrival_time must be specified as an integer.
 /// </param>
 /// <param name="language">
 /// Specifies the language in which to return results.\n
 /// Note that we often update supported languages so this list may not be exhaustive.\n
 /// If language is not supplied, the service will attempt to use the native language of the domain from which the request is sent.
 /// </param>
 /// <returns>Instance of the search query.</returns>
 public static OnlineMapsFindDirectionAdvanced Find(
     string origin,
     string destination,
     OnlineMapsFindDirectionMode mode = OnlineMapsFindDirectionMode.driving,
     string[] waypoints = null,
     bool alternatives = false,
     OnlineMapsFindDirectionAvoid avoid = OnlineMapsFindDirectionAvoid.none,
     OnlineMapsFindDirectionUnits units = OnlineMapsFindDirectionUnits.metric,
     string region = null,
     long departure_time = -1,
     long arrival_time = -1,
     string language = null)
 {
     OnlineMapsFindDirectionAdvanced query = new OnlineMapsFindDirectionAdvanced(origin, destination, mode, waypoints, alternatives, avoid, units, region, departure_time, arrival_time, language);
     OnlineMaps.instance.AddGoogleAPIQuery(query);
     return query;
 }