mobileCurrentHeading

Typefunction
DictionaryLCS
LibraryLiveCode Script
Syntax
mobileCurrentHeading()
Synonymsiphonecurrentheading()
Summary

Returns the current heading of the device.

Introduced4.6.1
OSios, android
Platformsmobile
Example
get mobileCurrentHeading()
put mobileCurrentHeading() into theHeading
Values
NameTypeDescription
return

If heading tracking has been enabled the mobileCurrentHeading function returns an array with the following keys: - "accuracy": The maximum deviation (measured in degrees) between the reported heading and true geomagnetic heading. The lower the value, the more accurate the reading. - "magnetic heading": The heading (measured in degrees) relative to magnetic north. true heading - The heading (measured in degrees) relative to true north. If the true heading could not be calculated (usually due to heading tracking not being enabled, or lack of calibration), this key will not be present. - "heading": The true heading if available, otherwise the magnetic heading. x, y, z - The geomagnetic data (measured in microteslas) for each of the x, y and z axes. - "timestamp": The time at which the measurement was taken, in seconds since 1970.

RelatedCommand: mobileStopTrackingSensor, mobileStartTrackingSensor
Function: mobileSensorReading, mobileCanTrackHeading
Message: trackingError, headingChanged
Description

Use the mobileCurrentHeading function to find the current heading of the device.