Reputation: 46
After long sleepless nights, I have finally managed to integrate a decent tilt handler into a plugin that I am working on, that can detect if a browser can handle tilt, then if the device running that browser can handle tilt, the device's potrait or landscape orientation.... blah blah.
After everything was complete, I began testing it on difference devices. However, an interesting nuisance showed up when I tried it on my ipad air running ios 9.3.2. Here is the part of the code that I use to test the orientation:
function handleOrientation(event)
{
var alphaQ = event.alpha;
var betaQ = event.beta;
var gammaQ = event.gamma;
var divnamehere = document.getElementById("somediv");
divnamehere.innerHTML = "Alpha:" + alphaQ + "<br>Beta: " +
betaQ + "<br>Gamma: " + gammaQ;
}
window.addEventListener("deviceorientation", handleOrientation, false);
Now this shows a Gamma value that exceeds +-90 degrees and can give up to +-180 degrees. But the Alpha's limit is from 0 to 360 degrees, for beta it's -180 to 180 degrees and for Gamma it would be -90 to +90 (not 180).
Only reason I can think of would be that ipad gyroscope works differently. Can someone please confirm? Uncle google is failing me.
Upvotes: 0
Views: 140
Reputation: 46
This is confirmed. In iPad Air, Gamma rotation is +180 to -180 instead of +90 to -90.
Upvotes: 1