diff --git a/index.html b/index.html
index 2cff4ff..93b3558 100644
--- a/index.html
+++ b/index.html
@@ -77,6 +77,13 @@
Availability offline
diff --git a/js/app.js b/js/app.js
index 2b1cb9f..fd41d96 100644
--- a/js/app.js
+++ b/js/app.js
@@ -389,7 +389,7 @@ $(window).ready(function() {
if(offline.get('opt_daylight')) $('#sw_daylight').removeClass('off').addClass('on');
// offline and mobile
- $('#sw_offline, #sw_station, #sw_imperial').click(function() {
+ $('#sw_offline, #sw_station, #sw_imperial, #sw_haxis_hours').click(function() {
var e = $(this);
var name = e.attr('id').replace('sw', 'opt');
var on;
@@ -403,12 +403,13 @@ $(window).ready(function() {
}
offline.set(name, on);
- if(name == "opt_imperial") refreshUI();
+ if(name == "opt_imperial" || name == "opt_haxis_hours") refreshUI();
});
if(offline.get('opt_offline')) $('#sw_offline').removeClass('off').addClass('on');
if(offline.get('opt_station')) $('#sw_station').removeClass('off').addClass('on');
if(offline.get('opt_imperial')) $('#sw_imperial').removeClass('off').addClass('on');
+ if(offline.get('opt_haxis_hours')) $('#sw_haxis_hours').removeClass('off').addClass('on');
// force re-cache
$('#sw_cache').click(function() {
diff --git a/js/tracker.js b/js/tracker.js
index acebe60..387d9be 100644
--- a/js/tracker.js
+++ b/js/tracker.js
@@ -358,7 +358,11 @@ function updateVehicleInfo(index, position) {
var imp = offline.get('opt_imperial');
var ascent_text = imp ? (vehicles[index].ascent_rate * 196.850394).toFixed(1) + ' ft/min' : vehicles[index].ascent_rate.toFixed(1) + ' m/s';
- var hrate_text = imp ? (vehicles[index].horizontal_rate * 196.850394).toFixed(1) + ' ft/min' : vehicles[index].horizontal_rate.toFixed(1) + ' m/s';
+ if (offline.get('opt_haxis_hours')) {
+ var hrate_text = imp ? (vehicles[index].horizontal_rate * 2.23693629).toFixed(1) + ' mph' : (vehicles[index].horizontal_rate * 3.6).toFixed(1) + ' km/h';
+ } else {
+ var hrate_text = imp ? (vehicles[index].horizontal_rate * 196.850394).toFixed(1) + ' ft/min' : vehicles[index].horizontal_rate.toFixed(1) + ' m/s';
+ }
var coords_text;
var ua = navigator.userAgent.toLowerCase();
@@ -816,7 +820,7 @@ function addPosition(position) {
- convert_time(vehicle.curr_position.gps_time);
if(dt != 0) {
- // calcualte vertical rate
+ // calculate vertical rate
var rate = (position.gps_alt - vehicle.curr_position.gps_alt) / dt;
vehicle.ascent_rate = 0.7 * rate
+ 0.3 * vehicle.ascent_rate;