[OpenLayers-Commits] r11357 - sandbox/sbrunner/openlayers/examples
commits-20090109 at openlayers.org
commits-20090109 at openlayers.org
Wed Feb 23 11:57:01 EST 2011
Author: sbrunner
Date: 2011-02-23 08:57:01 -0800 (Wed, 23 Feb 2011)
New Revision: 11357
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:52:41 UTC (rev 11356)
+++ sandbox/sbrunner/openlayers/examples/geolocation.js 2011-02-23 16:57:01 UTC (rev 11357)
@@ -110,13 +110,13 @@
};
$('track').checked = false;
-
+var first = true;
// Device Orientation
- window.alert(111);
+if (first) window.alert(111);
if (window.DeviceOrientationEvent) {
- window.alert(222);
+if (first) window.alert(222);
var f = function(event) {
- window.alert(333);
+if (first) window.alert(333);
// if (event.alpha) {
var orientation = event.alpha - window.orientation - 90;
var img = OpenLayers.Util.getElement('northimg');
@@ -125,22 +125,24 @@
img.style.webkitTransform = value;
if (arrow) {
- window.alert(777);
- window.alert(""+orientation);
- window.alert(""+typeof(arrow));
- window.alert(""+typeof(arrow.style));
+
+if (first) window.alert(777);
+if (first) window.alert(""+orientation);
+if (first) window.alert(""+typeof(arrow));
+if (first) window.alert(""+typeof(arrow.style));
arrow.style.rotation = -orientation;
- window.alert(888);
+if (first) window.alert(888);
arrow.layer.drawFeature(arrow);
- window.alert(999);
+if (first) window.alert(999);
+first =false;
}
if (event.alpha) {
}
else {
// OpenLayers.Util.getElement('north').style.display = "none";
}
- window.removeEventListener("deviceorientation", f, true);
+// window.removeEventListener("deviceorientation", f, true);
};
window.addEventListener("deviceorientation", f, true);
}
More information about the Commits
mailing list