Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All

compassneedscalibration | oncompassneedscalibration event

Fires whenever the device magnetometer changes to a state of unreliable or approximate accuracy.




Event Property object.oncompassneedscalibration = handler;
addEventListener Method object.addEventListener("compassneedscalibration", handler, useCapture)


Event information



Event handler parameters

pEvtObj [in]

Type: IHTMLEventObj


The states of unreliable and approximate accuracy are defined by the MagnetometerAccuracy enumeration of the Windows.Devices.Sensors namespace.

This event also fires shortly after a listener is added if the compass is already in an unreliable or approximate accuracy state. It will not fire if the compass accuracy is unknown.

The last known accuracy is tracked on a per-target basis. If the event is fired on a page and then the page is refreshed, a new event will be fired (since there will be a new Window object).

This event is useful in cases where having the user calibrate the compass on their device will increase the accuracy of the data provided by the DeviceOrientationEvent.

See also




© 2015 Microsoft