diff --git a/html/planeObject.js b/html/planeObject.js
index d390ff2..d921dc1 100644
--- a/html/planeObject.js
+++ b/html/planeObject.js
@@ -1432,11 +1432,10 @@ 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);
- const lastVisible = this.visible;
this.visible = (!this.isFiltered() && this.checkVisible());
if (this.visible) {
- if (this.drawLine || redraw || lastVisible != this.visible)
+ if (this.drawLine || redraw || this.lastVisible != this.visible)
this.updateLines();
this.updateMarker();
@@ -1444,13 +1443,15 @@ PlaneObject.prototype.updateFeatures = function(now, last, redraw) {
if (this == SelectedPlane && FollowSelected && this.position)
OLMap.getView().setCenter(ol.proj.fromLonLat(this.position));
}
- if (!this.visible && lastVisible) {
+ if (!this.visible && this.lastVisible) {
this.clearMarker();
this.clearLines();
this.selected = false;
if (SelectedPlane == this.icao)
selectPlaneByHex(null,false);
}
+
+ this.lastVisible = this.visible;
};
PlaneObject.prototype.clearMarker = function() {
@@ -2540,7 +2541,7 @@ PlaneObject.prototype.checkVisible = function() {
return (
(!globeIndex && this.seen < (58 - tisbReduction + jaeroTime))
|| (globeIndex && this.seen_pos < Math.max(getInactive(), 70) / 100 * (40 + zoomedOut + jaeroTime + mlatTime - tisbReduction))
- || (this.selected && (onlySelected || (!SelectedAllPlanes && !multiSelect)))
+ || (this.selected && (onlySelected || !multiSelect))
|| noVanish
);
};
diff --git a/html/script.js b/html/script.js
index 88293a8..4318113 100644
--- a/html/script.js
+++ b/html/script.js
@@ -2539,6 +2539,7 @@ function refreshFeatures() {
TrackedHistorySize += plane.history_size;
plane.inView = !plane.isFiltered() && inView(plane.position, lastRealExtent);
+ plane.visible = !plane.isFiltered() && plane.checkVisible();
plane.showInTable = false;
@@ -3005,7 +3006,7 @@ function setSelectedInfoBlockVisibility() {
$('#large_mode_control').css('left', (190 * globalScale) + 'px');
$('.ol-scale-line').css('left', (180 * globalScale + 8) + 'px');
- if (document.getElementById('map_canvas').clientWidth < parseFloat($('#selected_infoblock').css('width')) * 2.5) {
+ if (mapIsVisible && document.getElementById('map_canvas').clientWidth < parseFloat($('#selected_infoblock').css('width')) * 2.5) {
$('#selected_infoblock').css('height', '290px');
$('#large_mode_control').css('left', (5 * globalScale) + 'px');
$('#photo_container').addClass('hidden');
@@ -3759,6 +3760,8 @@ function checkRefresh() {
}
}
function mapRefresh() {
+ if (!mapIsVisible)
+ return;
//console.log('mapRefresh()');
let addToMap = [];
let lastRenderExtent = null;