问题
I am working on android device orientation and getting same values of event.alpha (270) in following positions as shared in image. i am using following code:
// called on device orientation change
function onHeadingChange(event) {
var heading = event.alpha;
if (typeof event.webkitCompassHeading !== "undefined") {
heading = event.webkitCompassHeading; //iOS non-standard
}
if (typeof heading !== "undefined" && heading !== null) {
alert("heading:"+ heading);
}
}
来源:https://stackoverflow.com/questions/62453531/onheadingchangeevent-getting-single-value-for-geometrically-opposite-positions