[OpenLayers-Commits] r11186 - sandbox/cmoullet/openlayers/examples

commits-20090109 at openlayers.org commits-20090109 at openlayers.org
Mon Feb 21 09:58:52 EST 2011


Author: cmoullet
Date: 2011-02-21 06:58:52 -0800 (Mon, 21 Feb 2011)
New Revision: 11186

Modified:
   sandbox/cmoullet/openlayers/examples/accelerometer.html
Log:
Add debugging information

Modified: sandbox/cmoullet/openlayers/examples/accelerometer.html
===================================================================
--- sandbox/cmoullet/openlayers/examples/accelerometer.html	2011-02-21 14:55:01 UTC (rev 11185)
+++ sandbox/cmoullet/openlayers/examples/accelerometer.html	2011-02-21 14:58:52 UTC (rev 11186)
@@ -16,15 +16,16 @@
     <script type="text/javascript">
         var result = document.getElementById('result');
         function init() {
-            console.log(isEventSupported('deviceorientation', window));
             if (isEventSupported('deviceorientation', window) || isEventSupported('mozorientation', window) || isEventSupported('devicemotion', window)) {
                 if (window.DeviceOrientationEvent) {
+                    alert("window.DeviceOrientationEvent supported");
                     window.addEventListener("deviceorientation", function () {
                         result.innerHTML = "Alpha: " + event.alpha;
                         result.innerHTML = result.innerHTML + "Beta: " + event.beta;
                         result.innerHTML = result.innerHTML + "Gamma: " + event.gamma;
                     }, true);
                 } else if (window.DeviceMotionEvent) {
+                    alert("window.DeviceMotionEvent supported");
                     window.addEventListener('devicemotion', function () {
                         tilt([event.acceleration.x * 2, event.acceleration.y * 2]);
                         result.innerHTML = "acceleration.x: " + event.acceleration.x;
@@ -38,6 +39,7 @@
                         result.innerHTML = result.innerHTML + "rotationRate.gamm: " + event.rotationRate.gamma;
                     }, true);
                 } else {
+                    alert("window.MozOrientation supported");
                     window.addEventListener("MozOrientation", function () {
                         result.innerHTML = "orientation.x: " + orientation.x;
                         result.innerHTML = result.innerHTML + "orientation.y: " + orientation.y;



More information about the Commits mailing list