Distance to destination: metres
Bearing to destination: degrees
Current heading: degrees
Difference in heading and bearing: degrees
I am working on a project that takes the compass script from Phonegap and i would like to connect it to my currect GPS position and than point to a fixed GPS position (like a re
The following code basically does what you want. It calculates the distance and bearing from your current location (by GPS) to a destination position and uses the compass to determine your current heading. The difference between your current heading and the bearing to the destination is the angle for your arrow.
The code with assets and compiled Android APK can be downloaded from here: http://ge.tt/4Kb2oQv/v/0
Here's the code, hope it helps!
Compass test
Distance to destination: metres
Bearing to destination: degrees
Current heading: degrees
Difference in heading and bearing: degrees
Destination