Skip to content

Commit

Permalink
fix: assigning in an if
Browse files Browse the repository at this point in the history
  • Loading branch information
afonsosousah committed Jun 12, 2024
1 parent e841a2e commit e373710
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions scripts/map.js
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,7 @@ function getLocation(zoom = true) {
last5PositionsAngles.push(-90 * (Math.PI / 180) + Math.atan2(diffLat, diffLon));
if (last5PositionsAngles.length > 5) last5PositionsAngles.shift();
}
arrayStandardDeviation(last5PositionsAngles) < 0.10 ? (inStraightLine = true) : (inStraightLine = false);
arrayStandardDeviation(last5PositionsAngles) < 0.1 ? (inStraightLine = true) : (inStraightLine = false);
document.querySelectorAll("#posAngles").forEach(elem => {
if (inStraightLine) {
elem.innerHTML = "in straight";
Expand Down Expand Up @@ -504,7 +504,7 @@ function startLocationDotRotation() {
if (!pos) return;

// Reset offset if under 5kph
if (!gpsHeading || speed = 0) {
if (!gpsHeading || speed === 0) {
// Reset offset
deviceHeadingOffset = 0;

Expand Down

0 comments on commit e373710

Please sign in to comment.