Compass.js allow you to get compass heading in JavaScript by PhoneGap, iOS API or GPS hack.
Andrey "A.I." Sitnik
无