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

commits-20090109 at openlayers.org commits-20090109 at openlayers.org
Wed Feb 23 11:11:04 EST 2011


Author: sbrunner
Date: 2011-02-23 08:11:04 -0800 (Wed, 23 Feb 2011)
New Revision: 11348

Modified:
   sandbox/sbrunner/openlayers/examples/geolocation.js
Log:
add debug messages

Modified: sandbox/sbrunner/openlayers/examples/geolocation.js
===================================================================
--- sandbox/sbrunner/openlayers/examples/geolocation.js	2011-02-23 16:04:14 UTC (rev 11347)
+++ sandbox/sbrunner/openlayers/examples/geolocation.js	2011-02-23 16:11:04 UTC (rev 11348)
@@ -123,16 +123,17 @@
                 }
 // Device Orientation
 if (window.DeviceOrientationEvent) {
-    window.addEventListener("deviceorientation", function(event) {
+    function f = function(event) {
         if (event.alpha) {
             var orientation = event.alpha - window.orientation - 90;
             var img = OpenLayers.Util.getElement('northimg');
             var value = "rotate(" + orientation + "deg)";
             img.style.transform = value;
-            img.style.webkitTransform = value;
+                img.style.webkitTransform = value;
         window.alert(777);
-        window.alert(""+arrow);
-        window.alert(""+arrow.style);
+        window.alert(""+orientation);
+        window.alert(""+arrow.fid);
+        window.alert(""+arrow.style.rotation);
 
             arrow.style.rotation = -orientation;
         window.alert(888);
@@ -142,7 +143,9 @@
         else {
             OpenLayers.Util.getElement('north').style.display = "none";
         }
-    }, true);
+        window.removeEventListener("deviceorientation", f, true);
+    };
+    window.addEventListener("deviceorientation", f, true);
 }
 else {
     OpenLayers.Util.getElement('north').style.display = "none";



More information about the Commits mailing list