apache / apache/cordova-plugin-device-orientation
Horizontal compass heading not working
- Dominant language
- JavaScript
- Stars
- 63
- Forks
- 80
- PR merge metrics
- No merged PRs in 30d
Description
Hi, i've been using this plugin to get the absolute north point.
There is some problem with it. When using `navigator.compass.getCurrentHeading(console.log);`
If the phone is in portrait mode there is no problem...the value goes from 0 to 359.99
But when the phone is in landscape mode the values are totally wrong and not stable at all,
varying almost +/-20 degrees... Soo, how to get the right value?
```
Orientation | Degrees | Degrees |
----------------------------------
Portrait | 0 | 45 |
Landscape | 20 | 80 |
UpsideDown | 160 | 220 |
Landscape | 190 | 350 |
```
Contributor guide
Research direction
Start with navigator.compass.getCurrentHeading and reproduce the reported readings in portrait and landscape orientations. Inspect the plugin's platform-specific compass handling, then verify that headings remain stable and correctly represent absolute north in every listed orientation.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- mobile-dev
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100