安卓系统可以,未测试ios
plus.orientation.getCurrentOrientation((res) => {
const {alpha,gamma} = res
this.direction = ((360 - ((alpha - gamma) % 360) + 360) % 360).toFixed(2)
})
plus.orientation.getCurrentOrientation使用官方网站:
安卓系统可以,未测试ios
plus.orientation.getCurrentOrientation((res) => {
const {alpha,gamma} = res
this.direction = ((360 - ((alpha - gamma) % 360) + 360) % 360).toFixed(2)
})
plus.orientation.getCurrentOrientation使用官方网站: