[OpenLayers-Commits] r11301 - sandbox/sbrunner/openlayers/examples

commits-20090109 at openlayers.org commits-20090109 at openlayers.org
Wed Feb 23 06:24:09 EST 2011


Author: sbrunner
Date: 2011-02-23 03:24:09 -0800 (Wed, 23 Feb 2011)
New Revision: 11301

Modified:
   sandbox/sbrunner/openlayers/examples/mobile.js
Log:
test rotate arraw

Modified: sandbox/sbrunner/openlayers/examples/mobile.js
===================================================================
--- sandbox/sbrunner/openlayers/examples/mobile.js	2011-02-23 11:19:03 UTC (rev 11300)
+++ sandbox/sbrunner/openlayers/examples/mobile.js	2011-02-23 11:24:09 UTC (rev 11301)
@@ -75,3 +75,13 @@
     map.pan(size.w * fx, size.h * fy);
 }
 
+                if (window.DeviceMotionEvent) {
+                    window.addEventListener('devicemotion', function (event) {
+                        if (typeof(event.rotationRate) != 'undefined') {
+                            document.getElementById('resultDeviceMotion').innerHTML = document.getElementById('resultDeviceMotion').innerHTML + "rotationRate.alpha: " + event.rotationRate.alpha + "<br>";
+                            document.getElementById('resultDeviceMotion').innerHTML = document.getElementById('resultDeviceMotion').innerHTML + "rotationRate.beta: " + event.rotationRate.beta + "<br>";
+                            document.getElementById('resultDeviceMotion').innerHTML = document.getElementById('resultDeviceMotion').innerHTML + "rotationRate.gamma: " + event.rotationRate.gamma + "<br>";
+                        }
+                    }, true);
+                }
+



More information about the Commits mailing list