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
37 changes: 37 additions & 0 deletions js/plot_config.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,43 @@ function updateLegend(pos) {
}

if(follow_vehicle !== null && vehicles[follow_vehicle].positions.length) {
// adjust index for null data points
var null_count = 0;

if (!map.hasLayer(polyMarker) && polyMarker) {
map.addLayer(polyMarker);
}

if(outside && pij !== undefined) {
if(!polyMarker) {
try {polyMarker = new L.Marker(vehicles[follow_vehicle].prediction_polyline.getLatLngs()[pij]).addTo(map);} catch (e) {};
} else {
try {polyMarker.setLatLng(vehicles[follow_vehicle].prediction_polyline.getLatLngs()[pij]);} catch (e) {};
}

}
else {
var data_ref = vehicles[follow_vehicle].graph_data[0];

if(ij > data_ref.data.length / 2) {
for(i = data_ref.data.length - 1; i > ij; i--) null_count += (data_ref.data[i][1] === null) ? 1 : 0;
null_count = data_ref.nulls - null_count * 2;
} else {
for(i = 0; i < ij; i++) null_count += (data_ref.data[i][1] === null) ? 1 : 0;
null_count *= 2;
}

// update position
ij -= null_count + ((null_count===0||null_count===data_ref.nulls) ? 0 : 1);
if(ij < 0) ij = 0;

if(!polyMarker) {
try {polyMarker = new L.Marker(vehicles[follow_vehicle].positions[ij]).addTo(map);} catch (e) {};
} else {
try {polyMarker.setLatLng(vehicles[follow_vehicle].positions[ij]);} catch (e) {};
}
}

// set timebox
var date = new Date(pos.x1);
$('#timebox').removeClass('present').addClass('past');
Expand Down
21 changes: 15 additions & 6 deletions js/tracker.js
Original file line number Diff line number Diff line change
Expand Up @@ -427,7 +427,10 @@ function load() {
receiverCanvas.addTo(map);

// initalize nite overlay
nite = new L.terminator({ renderer: svgRenderer });
nite = new L.terminator({
renderer: svgRenderer,
interactive: false,
});

if (offline.get("opt_daylight")) {
map.addLayer(nite);
Expand Down Expand Up @@ -1260,8 +1263,12 @@ function set_polyline_visibility(vcallsign, val) {
vehicle.polyline_visible = val;

for(var k in vehicle.polyline) {
if (val) map.addLayer(vehicle.polyline[k]);
else map.removeLayer(vehicle.polyline[k]);
if (val) {
map.addLayer(vehicle.polyline[k]);
vehicle.polyline[k].bringToBack();
} else {
map.removeLayer(vehicle.polyline[k]);
}
}

map.removeLayer(mapInfoBox);
Expand Down Expand Up @@ -2091,6 +2098,7 @@ function addPosition(position) {
iconUrl: host_url + markers_url + nyan,
iconSize: [nyanw,39],
iconAnchor: [26,20],
tooltipAnchor: [0,-29],
});

vehicle_info.marker.setIcon(nyanIcon);
Expand Down Expand Up @@ -2129,8 +2137,9 @@ function addPosition(position) {
map.removeLayer(vehicle_info["prediction_burst"]);
}
try {
map.removeLayer(polyline[0]);
map.removeLayer(polyline[1]);
for(var p in vehicle_info.polyline) {
map.removeLayer(vehicle_info.polyline[p]);
}
} catch (e) {};
for (let i = 0; i < potentialobjects.length; i++) {
if (map.hasLayer(potentialobjects[i])) {
Expand Down Expand Up @@ -2296,7 +2305,7 @@ function updateGraph(vcallsign, reset_selection) {
if(reset_selection) {
if(vcallsign !== null) delete plot_options.xaxis;

if(polyMarker) map.remove(polyMarker);
if(polyMarker) map.removeLayer(polyMarker);
plot_crosshair_locked = false;

$("#timebox").removeClass('past').addClass('present');
Expand Down
2 changes: 1 addition & 1 deletion manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"short_name": "SondeHub",
"description": "A webapp for tracking radiosondes.",
"theme_color": "#00a3d3",
"background_color": "#33b5e5",
"background_color": "#00a3d3",
"display": "standalone",
"scope": "/",
"start_url": "/",
Expand Down