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 handler parameters
- pEvtObj [in]
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.