From 32bf7deb418e4d4055ea1a47b4ca321c75f71def Mon Sep 17 00:00:00 2001 From: Matthias Wirth Date: Wed, 4 Mar 2020 16:25:29 +0100 Subject: [PATCH] performance improvements for filtered views --- html/planeObject.js | 8 +++++++- html/script.js | 2 +- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/html/planeObject.js b/html/planeObject.js index b6da538..bc74c2f 100644 --- a/html/planeObject.js +++ b/html/planeObject.js @@ -966,6 +966,9 @@ PlaneObject.prototype.processTrace = function(show) { PlaneObject.prototype.updateData = function(now, last, data, init) { // get location data first, return early if only those are needed. + if (globeIndex && onlyMilitary && !this.military) + return; + this.updated = true; var newPos = false; @@ -1265,6 +1268,9 @@ PlaneObject.prototype.updateFeatures = function(now, last, redraw) { this.seen = Math.max(0, now - this.last_message_time) this.seen_pos = Math.max(0, now - this.position_time); + if (globeIndex && this.isFiltered()) + return; + var moved = false; if (this.updated) { @@ -1287,7 +1293,7 @@ PlaneObject.prototype.updateFeatures = function(now, last, redraw) { // Only clear the plane if it's not selected individually - if ( !this.isFiltered() && (!onlySelected || this.selected) && + if ( !this.isFiltered() && ( (!globeIndex && this.seen < (58 - tisbReduction)) || (globeIndex && this.seen_pos < (30 + zoomedOut + jaeroTime - tisbReduction)) diff --git a/html/script.js b/html/script.js index 46f4db7..f49dcb2 100644 --- a/html/script.js +++ b/html/script.js @@ -2087,7 +2087,7 @@ function refreshTableInfo() { tableplane.inView = inView(tableplane, lastRealExtent); if (globeIndex && !icaoFilter) { - if ((nMapPlanes < 100 || !onMobile) + if ((nMapPlanes < 150 || !onMobile) && (!onMobile || ZoomLvl > 10 || !tableplane.onGround) && (inView(tableplane, lastRenderExtent) || tableplane.selected)) { tableplane.updateFeatures(now, last);