Aircraft label styling

This commit is contained in:
eric1tran 2021-02-24 16:34:57 +00:00
parent c23438a5cf
commit ff7aafe0bb
1 changed files with 16 additions and 16 deletions

View File

@ -470,17 +470,17 @@ PlaneObject.prototype.updateIcon = function() {
this.markerIcon = icon;
if (AircraftLabels) {
if (AircraftLabels && this.flight != null) {
this.markerStyle = new ol.style.Style({
image: this.markerIcon,
text: new ol.style.Text({
text: this.flight,
fill: new ol.style.Fill({color: 'white' }),
stroke: new ol.style.Stroke({color: 'black', width: 3}),
textAlign: 'left',
textBaseline: "top",
offsetX: 20,
font: '12px sans-serif'
text: this.flight.trim(),
fill: new ol.style.Fill({color: 'white'}),
backgroundFill: new ol.style.Stroke({color: 'rgba(0, 47, 93, 0.8'}),
textAlign: 'center',
offsetY: -20,
font: '10px Helvetica',
padding: [1,0,0,2]
})
});
} else {
@ -510,17 +510,17 @@ PlaneObject.prototype.updateIcon = function() {
this.staticIcon.setOpacity(opacity);
}
if (AircraftLabels) {
if (AircraftLabels && this.flight != null) {
this.markerStyle = new ol.style.Style({
image: this.markerIcon,
text: new ol.style.Text({
text: this.flight,
fill: new ol.style.Fill({color: 'white' }),
stroke: new ol.style.Stroke({color: 'black', width: 3}),
textAlign: 'left',
textBaseline: "top",
offsetX: 20,
font: '12px sans-serif'
text: this.flight.trim(),
fill: new ol.style.Fill({color: 'white'}),
backgroundFill: new ol.style.Stroke({color: 'rgba(0, 47, 93, 0.8)'}),
textAlign: 'center',
offsetY: -20,
font: '10px Helvetica',
padding: [1,0,0,2]
})
});
} else {