WeChat Mini Program API Luopan
wx.onCompassChange(CALLBACK)
Monitor compass data, frequency: 5 times/second
CALLBACK return parameters:
Parameters | Type | Description |
---|---|---|
Number | Facing direction degrees |
Sample code:
wx.onCompassChange(function (res) { console.log(res.direction) })