GeoCoordinate.Course Properti
Definisi
Penting
Beberapa informasi terkait produk prarilis yang dapat diubah secara signifikan sebelum dirilis. Microsoft tidak memberikan jaminan, tersirat maupun tersurat, sehubungan dengan informasi yang diberikan di sini.
Mendapatkan atau mengatur judul dalam derajat, relatif terhadap utara sejati.
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
Nilai Properti
Judul dalam derajat, relatif terhadap utara yang benar.
Pengecualian
Course diatur di luar rentang yang valid.
Contoh
Contoh berikut mencetak Course properti dan Speed dari lokasi GeoCoordinatesaat ini.
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
Keterangan
Rentang yang valid mencakup nilai dari 0,0 hingga 360,0, dan Double.NaN
jika judul tidak ditentukan.
Berlaku untuk
Berkolaborasi dengan kami di GitHub
Sumber untuk konten ini dapat ditemukan di GitHub, yang juga dapat Anda gunakan untuk membuat dan meninjau masalah dan menarik permintaan. Untuk informasi selengkapnya, lihat panduan kontributor kami.