Skip to content

Commit

Permalink
fix: removed absolute values from heading offset
Browse files Browse the repository at this point in the history
  • Loading branch information
afonsosousah committed Jun 12, 2024
1 parent e373710 commit 72d51ff
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion scripts/map.js
Original file line number Diff line number Diff line change
Expand Up @@ -422,7 +422,7 @@ function getLocation(zoom = true) {
// Use GPS heading if user is ruffly in a straight line for the last 5 seconds and over 12kph
if (gpsHeading && inStraightLine && speed >= (12 * 1000) / (60 * 60)) {
// Calculate offset between gps heading and compass heading
deviceHeadingOffset = Math.PI - Math.abs(Math.abs(gpsHeading - compassHeading) - Math.PI);
deviceHeadingOffset = gpsHeading - compassHeading;

// Dev info
document.getElementById("headingSource").innerHTML = "GPS+Compass";
Expand Down

0 comments on commit 72d51ff

Please sign in to comment.