2

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);
    }
  }

enter image description here

0 Answers0