示例#1
0
 /// <summary>
 /// Takes a start and end points and query for possible transit routes.
 /// </summary>
 /// <param name="start">Start location.</param>
 /// <param name="end">End location.</param>
 /// <param name="time">A time or date that relates to the route query.</param>
 /// <param name="timeType">The TimeType of the dateTime parameter.</param>
 public static Task<BingMapsQueryResult> GetTransitRoute(GeoCoordinate start, GeoCoordinate end, DateTime time, TimeType timeType)
 {
     string rqp = new TransitQueryParameters(start.AsBingMapsPoint(), end.AsBingMapsPoint(), time, timeType)
                      {
                          MaxSolutions = 5,
                          RoutePathOutput = RoutePathOutput.Points
                      }.ToString();
     var queryUri = ConstructQueryUri("Routes/Transit", rqp);
     return ExecuteQuery(queryUri);
 }
示例#2
0
 /// <summary>
 /// Takes a start and end points and query for possible walking routes.
 /// </summary>
 /// <param name="start">Start location.</param>
 /// <param name="end">End location.</param>
 public static Task<BingMapsQueryResult> GetWalkingRoute(GeoCoordinate start, GeoCoordinate end)
 {
     var queryUri = ConstructQueryUri(
         "Routes/Walking",
         new RouteQueryParameters(start.AsBingMapsPoint(), end.AsBingMapsPoint()) { RoutePathOutput = RoutePathOutput.Points, Tolerances = new List<double> { 0.0000005 } }.ToString());
     return ExecuteQuery(queryUri);
 }
示例#3
0
 /// <summary>
 /// Takes a latitude/longitude location and query for the information related to this location.
 /// </summary>
 /// <param name="point">Location on map.</param>
 public static Task<BingMapsQueryResult> GetLocationInfo(GeoCoordinate point)
 {
     var queryUri = ConstructQueryUri(
         "Locations/" + point.AsBingMapsPoint(), null);
     return ExecuteQuery(queryUri);
 }