Skip to content
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
executable file 24 lines (13 sloc) 1.17 KB


by Keith Irwin

Compass is a web app written in plain HTML/CSS/JS. It uses DeviceOrientationEvent and geolocation to show a smartphone's GPS coordinates and polar orientation.


Open on a smartphone with a compass. Hold the phone level and it should show your direction.

Is this accurate?

No, not really. Results may vary. As of this writing, Firefox and Chrome browsers handle the DeviceOrientation spec differently. It's only been tested on Chrome for Android.

Known issues

  • When the screen is rotated, the image gets rotated 90 degrees. I don't know how this could be fixed.

Image sources

The images used in this app were labeled for reuse with modification:

You can’t perform that action at this time.