Route.Itinerary Property
Route.Itinerary Property
The directions, map view representations, and summary information about the route (RouteItinerary object).
Public Itinerary As RouteItinerary
[C#]
public RouteItinerary Itinerary;
Remarks
The Itinerary property is generated when a route is created by calling the RouteServiceSoap.CalculateSimpleRoute method or by calling the RouteServiceSoap.CalculateRoute method (when the RouteSpecification.ResultMask property value is Instruction).
Because directions are not required in the creation of a rendered map, the Itinerary property can be null when passing a route to the RenderServiceSoap.GetMap and RenderServiceSoap.GetLineDriveMap methods.
Example
[Visual Basic]
'Calculate a route and print instructions
Dim latLongs(1) As LatLong
latLongs(0) = New LatLong()
latLongs(0).Latitude = 40
latLongs(0).Longitude = -120
latLongs(1) = New LatLong()
latLongs(1).Latitude = 41
latLongs(1).Longitude = -121
Dim myRoute As Route
myRoute = routeService.CalculateSimpleRoute(latLongs, "MapPoint.NA", SegmentPreference.Quickest)
Dim i As Integer
For i = 0 To myRoute.Itinerary.Segments(0).Directions.Length - 1
Console.WriteLine(myRoute.Itinerary.Segments(0).Directions(i).Instruction)
Next i
[C#]
//Calculate a route and print instructions
LatLong[] latLongs = new LatLong[2];
latLongs[0] = new LatLong();
latLongs[0].Latitude = 40;
latLongs[0].Longitude = -120;
latLongs[1] = new LatLong();
latLongs[1].Latitude = 41;
latLongs[1].Longitude = -121;
Route myRoute;
myRoute = routeService.CalculateSimpleRoute(latLongs, "MapPoint.NA", SegmentPreference.Quickest);
for(int i = 0; i < myRoute.Itinerary.Segments[0].Directions.Length ; i++)
{
Console.WriteLine(myRoute.Itinerary.Segments[0].Directions[i].Instruction);
}
See Also
Route Class | RouteItinerary Class | RouteServiceSoap Class | RouteSpecification.ResultMask Property | RenderServiceSoap.GetMap Method