Skip to content

Commit da51b11

Browse files
fixed lookangles box to work with imperial units
1 parent 22757b1 commit da51b11

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

css/main.css

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,15 +108,15 @@ body {
108108
}
109109
.slickbox .bearing {
110110
margin-right: 5px;
111-
width: 60px;
111+
width: 70px;
112112
}
113113
.slickbox .elevation {
114114
margin-left: 5px;
115115
width: 100px;
116116
}
117117
.slickbox .range {
118118
margin-right: 5px;
119-
width: 60px;
119+
width: 70px;
120120
}
121121

122122
#mapscreen {

js/tracker.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,12 @@ function update_lookangles(idx) {
148148
$("#lookanglesbox .bearing").text(look.bearing);
149149
$("#lookanglesbox .elevation").text("Elevation: " + Math.round(look.elevation * 10000)/10000 + "°");
150150

151-
var range_string = (look.range < 10000) ? Math.round(look.range) + "m" : (Math.round(look.range/100)/10) + " km";
151+
var range_string = "";
152+
if(offline.get('opt_imperial')) {
153+
range_string = Math.round(look.range * 0.000621371192) + " miles";
154+
} else {
155+
range_string = (look.range < 10000) ? Math.round(look.range) + "m" : (Math.round(look.range/100)/10) + " km";
156+
}
152157
$("#lookanglesbox .range").text(range_string);
153158
}
154159

@@ -1482,6 +1487,7 @@ function refreshUI() {
14821487
}
14831488

14841489
mapInfoBox.close();
1490+
if(follow_vehicle > -1) update_lookangles(follow_vehicle);
14851491
}
14861492

14871493
var status = "";

0 commit comments

Comments
 (0)