fix labels ... not sure what the issue was

some cleanup
This commit is contained in:
Matthias Wirth
2020-12-10 13:35:58 +01:00
parent 14525743a0
commit 98da512cd9
2 changed files with 14 additions and 15 deletions

View File

@@ -1081,7 +1081,7 @@ PlaneObject.prototype.processTrace = function() {
this.visible = true;
if (!showTime) {
this.updateFeatures(now, _last);
this.updateFeatures(true);
}
if (showTime && FollowSelected) {
@@ -1425,14 +1425,10 @@ PlaneObject.prototype.updateData = function(now, last, data, init) {
PlaneObject.prototype.updateTick = function(redraw) {
this.visible = this.checkVisible() && !this.isFiltered();
if (this.dataSource == "uat") {
this.updateFeatures(uat_now, uat_last, redraw);
} else {
this.updateFeatures(now, last, redraw);
}
this.updateFeatures(redraw);
};
PlaneObject.prototype.updateFeatures = function(now, last, redraw) {
PlaneObject.prototype.updateFeatures = function(redraw) {
if (this.visible) {
if (this.drawLine || redraw || this.lastVisible != this.visible)
@@ -1526,9 +1522,11 @@ PlaneObject.prototype.updateMarker = function(moved) {
this.marker = new ol.Feature(this.point);
this.marker.hex = this.icao;
}
if (webgl && !enableLabels && this.marker && this.marker.visible) {
PlaneIconFeatures.removeFeature(this.marker);
delete this.marker;
if (webgl && !enableLabels && this.marker) {
if (this.marker.visible) {
PlaneIconFeatures.removeFeature(this.marker);
this.marker.visible = false;
}
}
if (webgl) {
@@ -1547,7 +1545,7 @@ PlaneObject.prototype.updateMarker = function(moved) {
this.glMarker.set('dy', (getSpriteY(this.shape) + 1) / glImapHeight);
}
if (this.marker) {
if (this.marker && (!webgl || enableLabels)) {
this.updateIcon();
if (!this.marker.visible) {
this.marker.visible = true;