Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 6 additions & 22 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<title>SondeHub Tracker</title>
<meta name="description" content="Live tracking of radiosonde flights. Data via SondeHub v2. Includes weather overlay, predictions, and access to historic radiosonde flights on sondehub." />
<meta name="author" content="Rossen Georgiev / Mark Jessop / Michaela Wheeler / Luke Prior" />
<link rel="search" type="application/opensearchdescription+xml" href="opensearchspec.xml" title="Search on Sondebhub Tracker">
<link rel="search" type="application/opensearchdescription+xml" href="opensearchspec.xml" title="Search on SondeHub Tracker">
<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1, maximum-scale=1"/>
<meta name="apple-mobile-web-app-title" content="SondeHub Tracker">
<meta name="apple-mobile-web-app-capable" content="yes" />
Expand Down Expand Up @@ -205,38 +205,22 @@ <h2><i class="icon-settings rfloat"></i>Settings</h2>
<input type="checkbox" id="opt_hide_titles">
</div>
</div>
<h4>Overlays</h4>
<hr/>
<div class="row option">
<span><b>Daylight overlay</b></span>
<div class="switch off" id="sw_daylight">
<span class="thumb"></span>
<input type="checkbox" id="opt_daylight">
</div>
</div>
<h4>Other</h4>
<hr/>
<div class="row option">
<span><b>Hide Launch Sites</b></span>
<div class="switch off" id="sw_layers_launches">
<span class="thumb"></span>
<input type="checkbox" id="opt_layers_launches">
</div>
</div>
<h4>Overlays</h4>
<hr/>
<div class="row option">
<span><b>Force check for new version</b></span>
<div class="switch off" id="sw_cache">
<span><b>Daylight overlay</b></span>
<div class="switch off" id="sw_daylight">
<span class="thumb"></span>
<input type="checkbox" id="opt_cache">
<input type="checkbox" id="opt_daylight">
</div>
</div>
<div class="row info">
<span>
Reloads appcache if necessary.
The size of cache files is 1.2 MB.
This does not include map tiles.
</span>
</div>
</div>
</div>
<div id="weatherbox" style="display: none" class="flatpage">
Expand Down
52 changes: 0 additions & 52 deletions js/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -181,27 +181,6 @@ for(var idx in params) {
}
}

$.ajaxSetup({ cache: true });

var force_check_cache = false;

// handle cachin events and display a loading bar
var loadComplete = function(e) {
clearTimeout(initTimer);

if(e.type == 'updateready') {
// swapCache may throw exception if the isn't a previous cache
try {
window.applicationCache.swapCache();
} catch(v) {}

window.location.reload();
return;
}

$('#loading .complete').stop(true,true).animate({width: 200}, {complete: trackerInit });
};

// loads the tracker interface
function trackerInit() {
$('#loading,#settingsbox,#aboutbox,#chasebox').hide(); // welcome screen
Expand All @@ -224,21 +203,6 @@ function trackerInit() {
// if for some reason, applicationCache is not working, load the app after a 3s timeout
var initTimer = setTimeout(trackerInit, 3000);

var cache = window.applicationCache;
// TEMPORARILY DISABLED - MJ 2020-08-29
// Application Cache is broken in recent chrome versions/
// Disabling these addEventListener calls at least makes the rest of the page load.
// Unsure what the implications of disabling these are.

//cache.addEventListener('noupdate', loadComplete, false);
//cache.addEventListener('updateready', loadComplete, false);
//cache.addEventListener('cached', loadComplete, false);
//cache.addEventListener('error', loadComplete, false);

// if the browser supports progress events, display a loading bar
//cache.addEventListener('checking', function() { if(map && !force_check_cache) return; force_check_cache = false; clearTimeout(initTimer); $('#loading .bar,#loading').show(); $('#loading .complete').css({width: 0}); }, false);
//cache.addEventListener('progress', function(e) { $('#loading .complete').stop(true,true).animate({width: (200/e.total)*e.loaded}); }, false);

var listScroll;
var GPS_ts = null;
var GPS_lat = null;
Expand Down Expand Up @@ -875,22 +839,6 @@ $(window).ready(function() {
if(offline.get(opt_name)) $(switch_id).removeClass('off').addClass('on');
}

// force re-cache
$('#sw_cache').click(function() {
var e = $(this).removeClass('off').addClass('on');
if(confirm("The app will automatically reload, if new version is available.")) {
force_check_cache = true;

try {
applicationCache.update();
} catch (v) {
force_check_cache = false;
alert("There is no applicationCache available");
}
}
e.removeClass('on').addClass('off');
});

// We are able to get GPS position on idevices, if the user allows
// The position is displayed in top right corner of the screen
// This should be very handly for in the field tracking
Expand Down
29 changes: 15 additions & 14 deletions js/tracker.js
Original file line number Diff line number Diff line change
Expand Up @@ -2311,7 +2311,20 @@ function addPosition(position) {
marker = new L.Marker(point, {
title: vcallsign,
zIndexOffset: Z_CAR,
}).addTo(map).on('click', onClick);
});

if(!!!window.HTMLCanvasElement) {
carIcon = L.icon({
iconUrl: image_src,
iconSize: image_src_size,
iconAnchor: [27.22],
tooltipAnchor: [0,-32],
});
marker.setIcon(new carIcon);
} else {
marker_rotate_setup(marker, image_src);
}
marker.addTo(map).on('click', onClick);

// Scroll list stuff here.
function onClick(e) {
Expand All @@ -2325,18 +2338,6 @@ function addPosition(position) {
refreshSingleNew(_vehicle_id);
};

if(!!!window.HTMLCanvasElement) {
carIcon = L.icon({
iconUrl: image_src,
iconSize: image_src_size,
iconAnchor: [27.22],
tooltipAnchor: [0,-32],
});
marker.setIcon(new carIcon);
} else {
marker_rotate_setup(marker, image_src);
}
marker.addTo(map);
polyline = [
new L.Polyline(point, {
color: car_colors[color_index],
Expand Down Expand Up @@ -2731,7 +2732,7 @@ function addPosition(position) {
}
} else {
var rate = (position.gps_alt - vehicle.positions_alts[vehicle.positions_alts.length - 5]) / dtt;
if (!isNaN(rate)) {
if (!isNaN(rate) && isFinite(rate)) {
vehicle.ascent_rate = 0.7 * rate + 0.3 * vehicle.ascent_rate;
}
}
Expand Down
10 changes: 5 additions & 5 deletions opensearchspec.xml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<?xml version="1.0"?>
<OpenSearchDescription xmlns="http://a9.com/-/spec/opensearch/1.1/" xmlns:moz="http://www.mozilla.org/2006/browser/search/">
<ShortName>Habhub Tracker</ShortName>
<Description>Habhub Tracker - Search</Description>
<ShortName>SondeHub Tracker</ShortName>
<Description>SondeHub Tracker - Search</Description>
<InputEncoding>UTF-8</InputEncoding>
<Contact>[email protected]</Contact>
<Image height="16" width="16" type="image/x-icon">https://tracker.habhub.org/favicon.ico</Image>
<Developer>Rossen Georgiev</Developer>
<Url type="text/html" method="get" template="https://tracker.habhub.org/#!qm=All&amp;q={searchTerms}" />
<Image height="16" width="16" type="image/x-icon">https://sondehub.org/favicon.ico</Image>
<Developer>Luke Prior</Developer>
<Url type="text/html" method="get" template="https://sondehub.org/#!f={searchTerms}&amp;mz=9&amp;qm=All&amp;q={searchTerms}" />
</OpenSearchDescription>
14 changes: 0 additions & 14 deletions track.kml

This file was deleted.