public GoogleDirectionsInput Create(string originId, string destinationId, GoogleTravelMode mode, DateTime departureTime) { LanguageType language = LanguageType.Pl; var startSeconds = GooglePlaceCalculator.ConvertToUnixTimestamp(departureTime); return(new GoogleDirectionsInput(originId, destinationId, mode, language, startSeconds)); }
public GoogleDirectionsInput(Location originLoc, Location destinationLoc, GoogleTravelMode mode, LanguageType language, double?departure_time = null) { OriginLoc = originLoc; DestinationLoc = destinationLoc; Mode = mode; Departure_time = departure_time; WaypointsLoc = new List <Location>(); WaypointsPlaceId = new List <string>(); OptimizeWaypoints = true; }
public GoogleDistanceMatrixInput(LanguageType language, GoogleTravelMode mode = GoogleTravelMode.Walking, int?departure_time = null) { Language = language; Mode = mode; Units = "metric"; Departure_time = departure_time; OriginsLoc = new List <Location>(); OriginsPlaceId = new List <string>(); DestinationsLoc = new List <Location>(); DestinationsPlaceId = new List <string>(); }
public PlanRouteStep(int distance, int duration, double startStepLat, double startStepLng, double endStepLat, double endStepLng, GoogleTravelMode travelMode, string htmlInstruction, string maneuver) { Distance = distance; Duration = duration; StartStepLat = startStepLat; StartStepLng = startStepLng; EndStepLat = endStepLat; EndStepLng = endStepLng; TravelMode = travelMode; HtmlInstruction = htmlInstruction; Maneuver = maneuver; }
public GoogleDirectionsInput(Location originLoc, Location destinationLoc, GoogleTravelMode mode, LanguageType language, IList <Location> waypoints, bool optimize, double?departure_time = null) { OriginLoc = originLoc; DestinationLoc = destinationLoc; Mode = mode; WaypointsLoc = new List <Location>(); foreach (var w in waypoints) { WaypointsLoc.Add(w); } WaypointsPlaceId = new List <string>(); OptimizeWaypoints = optimize; Departure_time = departure_time; }
public GoogleDirectionsInput Create(Location origin, Location destination, GoogleTravelMode mode, DateTime departureTime) { LanguageType language = LanguageType.Pl; var startSeconds = GooglePlaceCalculator.ConvertToUnixTimestamp(departureTime); if (startSeconds < 0) { return(new GoogleDirectionsInput(origin, destination, mode, language)); } else { return(new GoogleDirectionsInput(origin, destination, mode, language, startSeconds)); } }
//Required parameters: //-key //-origin — The address, textual latitude/longitude value, or place ID from which you wish to calculate directions. // - destination — The address, textual latitude/longitude value, or place ID //Optional parameters: //- language = {en, pl} //- mode {driving, walking, bicycling, transit(+departure_time, arrival_tie)} //- waypoints (intermediate locations) =via:lat%2Clng| =via:place_id:{id}|place_id:{id2} //- optimize waypoints( travelling salesperson problem) np &waypoints=optimize:true|Barossa+Valley,SA|Clare,SA // and return "waypoint_order": [ 3, 2, 0, 1 ] // -alternatives {true,false} alternative routes // - avoid {tolls|highways|ferries|indoor} // - unit={metirc} // - arrival_time/departure_time - Specifies the desired time of departure. You can specify the time as an integer in seconds since midnight, January 1, 1970 UTC //mode is driving: You can specify the departure_time to receive a route and trip duration that take traffic conditions into account. // -traffic_model {best_guess ,pessimistic ,optimistic ) // - transit_mode={bus,subway,train,tram,rail} // -transit_routing_preference {less_walking, fewer_transfers} public GoogleDirectionsInput CreateOptimizedWaypoints(Location originLoc, Location destinationLoc, GoogleTravelMode mode, IList <Location> waypoints, double?departure_time = null) { LanguageType language = LanguageType.Pl; return(new GoogleDirectionsInput(originLoc, destinationLoc, mode, language, waypoints, true, departure_time)); }