gpstrek - Remove obsolete compass heading workaround

pull/2222/head
Martin Boonk 2022-11-03 21:09:18 +01:00
parent 5374b1af30
commit c382bef7d9
2 changed files with 2 additions and 2 deletions

View File

@ -683,7 +683,7 @@ const compassSliceData = {
},
getCourse: function (){
if(compassSliceData.getCourseType() == "GPS") return state.currentPos.course;
return state.compassHeading?360-state.compassHeading:undefined;
return state.compassHeading?state.compassHeading:undefined;
},
getPoints: function (){
let points = [];

View File

@ -24,7 +24,7 @@ function onGPS(fix) {
}
function onMag(e) {
if (!state.compassHeading) state.compassHeading = 360-e.heading;
if (!state.compassHeading) state.compassHeading = e.heading;
//if (a+180)mod 360 == b then
//return (a+b)/2 mod 360 and ((a+b)/2 mod 360) + 180 (they are both the solution, so you may choose one depending if you prefer counterclockwise or clockwise direction)