Submit A Resource
Contact Us
About Functionn

Subscription Options

Subscribe By Email (265+)



Dec 4, 2012

Author: Hirvesh Posted At: 12/04/2012 Tags: , , ,

Compass.js - A JavaScript Library To Get Compass Heading On Mobile Phones


Compass.js allows you to get compass heading in JavaScript. Today we haven’t any standard way to get compass data, but there are two proprietary APIs and one hack:

  • PhoneGap has navigator.compass API.
  • iOS Safari adds webkitCompassHeading property to deviceorientation event.
  • We can enable GPS and ask user to go forward. GPS will send current heading, so we can calculate difference between real North and zero in deviceorientation event. Next we use this difference to get compass heading only by device orientation.

This library hides all this magic and APIs from you, auto-detects available way and provides clean and simple API for your geolocation web app.

Requirements: None
License: GPL

Daily Posts, Be Updated, Subscribe:

Want Free Web Resources? Enter Your Email And We'll Send It To You - Daily! (265+ Subscribers)

Yup, it's that straight forward! Enter your email address below and we'll send you the latest web resources to your inbox, everyday. We don't do spam. Ever.

Trending Posts On Functionn This Week


Other Interesting Resources:


Post a Comment


Recent Posts

Popular Categories

Popular Components

Popular Licenses