Share via


Direction.BearingOutOfTurn Property

Direction.BearingOutOfTurn Property

The compass angle of the route away from the LatLong property. For example, given an instruction in which you are traveling due east on a road, your BearingOutOfTurn property value as you start would be 90.0. Valid range is 0.0 through 360.0, indicating the angle of the bearing. Angle is clockwise from north (north is 0.0 or 360.0). Single.


Public Dim BearingOutOfTurn As Single
    Member of [Namespace].Direction

[C#]

public System.Single BearingOutOfTurn
    Member of [Namespace].Direction

Example

[Visual Basic]

'Calculate a route, print instructions, 
'and add a note for the bearing
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)
 If (myRoute.Itinerary.Segments(0).Directions(i).BearingOutOfTurn = 180) Then
  Console.WriteLine("The compass angle ahead of you is 180 degrees.")
 End If
Next i



[C#]

//Calculate a route, print instructions, 
//and add a note for the bearing
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);
 if (myRoute.Itinerary.Segments[0].Directions[i].BearingOutOfTurn == 180) 
 {
  Console.WriteLine("The compass angle ahead of you is 180 degrees.");
 }
}


See Also

  Direction Class   |   Direction.LatLong Property