Gets or sets the speed in meters per second.
The speed in meters per second.
The speed must be greater than or equal to zero, or NaN.
The following example prints the Course and Speed properties of the current location's GeoCoordinate.
CopyC#
static void GetLocationCourseAndSpeed() { GeoCoordinateWatcher watcher = new GeoCoordinateWatcher(); watcher.Start(); System.Threading.Thread.Sleep(1000); if (watcher.Position.Location.IsUnknown != true) { GeoCoordinate coord = watcher.Position.Location; Debug.WriteLine("Course: {0}, Speed: {1}", coord.Course, coord.Speed); } else { Debug.WriteLine("Unknown"); } }
| Exception | Condition |
|---|---|
| ArgumentOutOfRangeException | Speed is set outside the valid range. |