Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prevent auto-selection of aircraft with no updated position within 20 seconds #310

Closed
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
6 changes: 4 additions & 2 deletions html/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -8148,12 +8148,14 @@ function autoSelectClosest() {
checkMovement();
for (let key in g.planesOrdered) {
const plane = g.planesOrdered[key];
// If the plane is not visible, skip
if (!plane.visible)
continue;
// If there are no position within 20 seconds, skip
if (plane.position == null || plane.seen_pos > 20)
continue;
if (!closest)
closest = plane;
if (plane.position == null)
continue;
let refLoc = [CenterLon, CenterLat];
if (autoselectCoords && autoselectCoords.length == 2) {
refLoc = [ autoselectCoords[1], autoselectCoords[0] ];
Expand Down