From 20dff38cf76ed2cf9d67c9d1c1b171c348f2b428 Mon Sep 17 00:00:00 2001 From: Peter Bastiani Date: Mon, 21 Aug 2023 16:59:54 +0200 Subject: [PATCH] AW1873 labels -> undefined/null fixes --- .../aol/item-vector-source/item-vector-source.component.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/projects/common-map/src/fm-map/components/aol/item-vector-source/item-vector-source.component.ts b/projects/common-map/src/fm-map/components/aol/item-vector-source/item-vector-source.component.ts index bd37d49..726fe6b 100644 --- a/projects/common-map/src/fm-map/components/aol/item-vector-source/item-vector-source.component.ts +++ b/projects/common-map/src/fm-map/components/aol/item-vector-source/item-vector-source.component.ts @@ -210,9 +210,9 @@ export class ItemVectorSourceComponent extends SourceVectorComponent implements if (!this.labelToolSettings) return null; let displayText = ''; if (this.labelToolSettings.showFieldName) displayText += feature.get('name') + '\n'; - if (this.labelToolSettings.showCropName) displayText += feature.get('cropTypeName') + '\n'; - if (this.labelToolSettings.showArea) displayText += feature.get('area') + 'ha\n'; - if (this.labelToolSettings.showCentroid) displayText += this.getCentroid(feature); + if (this.labelToolSettings.showCropName && feature.get('cropTypeName')) displayText += feature.get('cropTypeName') + '\n'; + if (this.labelToolSettings.showArea && feature.get('area')) displayText += feature.get('area') + 'ha\n'; + if (this.labelToolSettings.showCentroid && this.getCentroid(feature)) displayText += this.getCentroid(feature); return new style.Text({ font: '13px Calibri,sans-serif',