max dist for ptracks

This commit is contained in:
Matthias Wirth
2022-08-02 12:52:56 +02:00
parent 25b2bb5695
commit 7742c0ceaf
2 changed files with 9 additions and 6 deletions

View File

@@ -1319,10 +1319,11 @@ PlaneObject.prototype.processTrace = function() {
PlaneObject.prototype.updatePositionData = function(now, last, data, init) {
if (this.position && SitePosition) {
if (pTracks && this.sitedist)
if (pTracks && this.sitedist) {
this.sitedist = Math.max(ol.sphere.getDistance(SitePosition, this.position), this.sitedist);
else
} else {
this.sitedist = ol.sphere.getDistance(SitePosition, this.position);
}
}
if (!globeIndex || this.selected || SelectedAllPlanes || replay) {