Skip to content
This repository has been archived by the owner on Dec 5, 2017. It is now read-only.

Commit

Permalink
device/compass: Heading needs orientation adjustment (iOS).
Browse files Browse the repository at this point in the history
  • Loading branch information
ariya committed Oct 19, 2011
1 parent 6d82a44 commit 1fabf35
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions device/compass/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,9 @@

if (typeof e.webkitCompassHeading !== 'undefined') {
direction = e.webkitCompassHeading;
if (typeof window.orientation !== 'undefined') {
direction += window.orientation;
}
} else {
// http://dev.w3.org/geo/api/spec-source-orientation.html#deviceorientation
direction = 360 - e.alpha;
Expand Down

0 comments on commit 1fabf35

Please sign in to comment.