Subversion Repositories Projects

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
2498 - 1

2
namespace GMap.NET
3
{
4
   using System.Collections.Generic;
5
 
6
   public class GDirections
7
   {
8
      /// <summary>
9
      /// contains a short textual description for the route, suitable for naming and disambiguating the route from alternatives.
10
      /// </summary>
11
      public string Summary;
12
 
13
      /// <summary>
14
      /// contains a human-readable representation of the duration.
15
      /// </summary>
16
      public string Duration;
17
 
18
      /// <summary>
19
      /// contains a value of the duration.
20
      /// </summary>
21
      public uint DurationValue;
22
 
23
      /// <summary>
24
      /// contains a human-readable representation of the distance, displayed in units as used at the origin
25
      /// (or as overridden within the units parameter in the request), in the language specified in the request.
26
      /// (For example, miles and feet will be used for any origin within the United States.)
27
      /// </summary>
28
      public string Distance;
29
 
30
      /// <summary>
31
      /// contains a value of the distance.
32
      /// </summary>
33
      public uint DistanceValue;
34
 
35
      /// <summary>
36
      /// contains the latitude/longitude coordinates of the origin of this leg. Because the Directions API
37
      /// calculates directions between locations by using the nearest transportation option (usually a road)
38
      /// at the start and end points, start_location may be different than the provided origin of this leg if,
39
      /// for example, a road is not near the origin.
40
      /// </summary>
41
      public PointLatLng StartLocation;
42
 
43
      /// <summary>
44
      /// contains the latitude/longitude coordinates of the given destination of this leg. Because the Directions
45
      /// API calculates directions between locations by using the nearest transportation option (usually a road)
46
      /// at the start and end points, end_location may be different than the provided destination of this leg if,
47
      /// for example, a road is not near the destination.
48
      /// </summary>
49
      public PointLatLng EndLocation;
50
 
51
      /// <summary>
52
      /// contains the human-readable address (typically a street address) reflecting the start_location of this leg.
53
      /// </summary>
54
      public string StartAddress;
55
 
56
      /// <summary>
57
      /// contains the human-readable address (typically a street address) reflecting the end_location of this leg.
58
      /// </summary>
59
      public string EndAddress;
60
 
61
      /// <summary>
62
      /// contains the copyrights text to be displayed for this route. You must handle and display this information yourself.
63
      /// </summary>
64
      public string Copyrights;
65
 
66
      /// <summary>
67
      /// contains an array of steps denoting information about each separate step of the leg of the journey.
68
      /// </summary>
69
      public List<GDirectionStep> Steps;
70
 
71
      /// <summary>
72
      /// contains all points of the route
73
      /// </summary>
74
      public List<PointLatLng> Route;
75
 
76
      public override string ToString()
77
      {
78
         return Summary + " | " + Distance + " | " + Duration;
79
      }
80
   }
81
 
82
   public struct GDirectionStep
83
   {
84
      public string TravelMode;
85
 
86
      /// <summary>
87
      /// contains the location of the starting point of this step, as a single set of lat and lng fields.
88
      /// </summary>
89
      public PointLatLng StartLocation;
90
 
91
      /// <summary>
92
      /// contains the location of the ending point of this step, as a single set of lat and lng fields.
93
      /// </summary>
94
      public PointLatLng EndLocation;
95
 
96
      /// <summary>
97
      ///  contains the typical time required to perform the step, until the next step. This field may be undefined if the duration is unknown.
98
      /// </summary>
99
      public string Duration;
100
 
101
      /// <summary>
102
      /// contains the distance covered by this step until the next step. This field may be undefined if the distance is unknown.
103
      /// </summary>
104
      public string Distance;
105
 
106
      /// <summary>
107
      /// contains formatted instructions for this step, presented as an HTML text string.
108
      /// </summary>
109
      public string HtmlInstructions;
110
 
111
      /// <summary>
112
      /// points of the step
113
      /// </summary>
114
      public List<PointLatLng> Points;
115
 
116
      public override string ToString()
117
      {
118
         return TravelMode + " | " + Distance + " | " + Duration + " | " + HtmlInstructions;
119
      }
120
   }
121
}