Gets the current direction of travel.
Returns a positive value (related to compass heading) if the call was successful, negative otherwise.
LocationGetCourse() returns the direction of travel as a compass heading. A value of 0 indicates north, 90 indicates east, 180 indicates south and 270 indicates west. A negative value indicates that course cannot be determined. Determination of course relies on having prior location data and a device that is moving. It is not unusual for a stationary device to report negative values even if GPS is available on the device.
Course data is not available on all devices, as it requires a GPS radio.
Windows Simulator NOTE: To provide values for the Windows Simulator, be sure to edit C:\DragonFireSDK\DragonFireSDK.ini and modify the value for Course in the Location section.
NOTE: It is recommended to call LocationMonitorLocation() prior to calling LocationGetCourse(). This gives the device time to begin receiving more and more accurate location data prior to getting location data. Subsequent calls to LocationGetCourse() may become more accurate over time as the device pinpoints your location.
Available in DragonFireSDK 1.4 and later on devices with GPS.
// Begin monitoring location
MyFont = FontAdd("Helvetica", "Regular", 24, 0x00FF00);
CourseText = TextAdd(10, 10, "Course:", MyFont);
course = LocationGetCourse();
sprintf(TextBuffer, "Course: %f degrees", course);