eeui plugin install https://github.com/aipaw/eeui-plugin-compass
eeui plugin uninstall https://github.com/aipaw/eeui-plugin-compass
const compass = app.requireModule("eeui/compass");
- [
callback
] (Function)
result
(Object)heading
(Float) (0~359.99, magnetic)
compass.get((ret) => {
console.log(ret)
})
-
[
options
] (Object)interval
(Int) (ms, default:32
)
-
[
callback
] (Function)
result
(Object)heading
(Float) (0~359.99, magnetic)
compass.watch((ret) => {
console.log(ret)
})
- [
callback
] (Function)
compass.clearWatch(() => {
console.log('cleared')
})
Error
COMPASS_PERMISSION_DENIED
COMPASS_NOT_SUPPORTED
COMPASS_INTERNAL_ERROR
GET_COMPASS_INVALID_ARGUMENT
WATCH_COMPASS_INVALID_ARGUMENT