From ce99004d8d6d405abe4d8b08f488d1419c4d9b91 Mon Sep 17 00:00:00 2001 From: Matthias Wirth Date: Sat, 3 Jul 2021 12:59:50 +0200 Subject: [PATCH] fix distance column issue for globeIndex --- html/planeObject.js | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/html/planeObject.js b/html/planeObject.js index 622df8c..ffc3966 100644 --- a/html/planeObject.js +++ b/html/planeObject.js @@ -313,13 +313,6 @@ PlaneObject.prototype.updateTrack = function(now, last, serverTrack, stale) { return false; } - if (this.position && SitePosition) { - if (pTracks && this.sitedist) - this.sitedist = Math.max(ol.sphere.getDistance(SitePosition, this.position), this.sitedist); - else - this.sitedist = ol.sphere.getDistance(SitePosition, this.position); - } - let projHere = ol.proj.fromLonLat(this.position); let on_ground = (this.altitude === "ground"); @@ -1149,6 +1142,13 @@ PlaneObject.prototype.processTrace = function() { }; PlaneObject.prototype.updatePositionData = function(now, last, data, init) { + if (this.position && SitePosition) { + if (pTracks && this.sitedist) + this.sitedist = Math.max(ol.sphere.getDistance(SitePosition, this.position), this.sitedist); + else + this.sitedist = ol.sphere.getDistance(SitePosition, this.position); + } + if (!globeIndex || this.selected || SelectedAllPlanes || replay) { let newPos = this.updateTrack(now, last); this.drawLine |= newPos;