GeoCoordinate.Course Propriété

Définition

Obtient ou définit la direction en degrés par rapport au nord géographique.

public:
 property double Course { double get(); void set(double value); };
public double Course { get; set; }
member this.Course : double with get, set
Public Property Course As Double

Valeur de propriété

Direction en degrés par rapport au nord géographique.

Exceptions

Course se trouve en dehors de la plage valide.

Exemples

L’exemple suivant imprime les Course propriétés et Speed de l’emplacement actuel.GeoCoordinate

static void GetLocationCourseAndSpeed()
{
    GeoCoordinateWatcher watcher = new GeoCoordinateWatcher();

    watcher.TryStart(true, TimeSpan.FromMilliseconds(1000));

    if (watcher.Position.Location.IsUnknown != true)
    {
        GeoCoordinate coord = watcher.Position.Location;

        Console.WriteLine("Course: {0}, Speed: {1}",
            coord.Course,
            coord.Speed);
    }
    else
    {
        Console.WriteLine("Unknown");
    }
}

Public Sub GetLocationCourseAndSpeed()
    Dim watcher As GeoCoordinateWatcher
    watcher = New System.Device.Location.GeoCoordinateWatcher()
    watcher.TryStart(False, TimeSpan.FromMilliseconds(1000))

    If Not watcher.Position.Location.IsUnknown Then
        Dim coord As GeoCoordinate = watcher.Position.Location
        Console.WriteLine("Course: {0}, Speed: {1}",
            coord.Course,
            coord.Speed) 'NaN if not available.
    Else
        Console.WriteLine("Location unknown.")
    End If

End Sub

Remarques

La plage valide inclut des valeurs comprises entre 0,0 et 360,0, et Double.NaN si le titre n’est pas défini.

S’applique à