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 0deebd0..285beff 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 @@ -46,7 +46,7 @@ export class ItemVectorSourceComponent extends SourceVectorComponent implements constructor(@Host() private layer: LayerVectorComponent, private itemService: ItemService, private map: MapComponent, private itemTypeService: ItemTypeService, private featureIconService$: FeatureIconService, private folderService: FolderService, @Inject(LOCALE_ID) private locale: string) { super(layer); - this._format = new GeoJSON(); + this._format = new GeoJSON(); } geometry(feature: Feature) { @@ -149,7 +149,7 @@ export class ItemVectorSourceComponent extends SourceVectorComponent implements fill: new style.Fill({ color: fillColor }), - geometry: (feature: Feature) => this.geometry(feature), + geometry: (feature: Feature) => this.geometry(feature), text: this.getDisplayTextForFeature(feature, this.map.instance.getView().getZoom()) }); } else { @@ -227,26 +227,27 @@ export class ItemVectorSourceComponent extends SourceVectorComponent implements const centroid = getCenter(feature.getGeometry().getExtent()); value = Math.round(centroid[0]) + ',' + Math.round(centroid[1]); } + } + if (value) { + displayText += value + (i < propertiesToShow.length ? '\n' : ''); + } } - if (value) { - displayText += value + (i < propertiesToShow.length ? '\n' : ''); - } - } - const styleText = new style.Text({ - font: '13px Calibri,sans-serif', - fill: new style.Fill({ color: '#ffffff' }), - stroke: new style.Stroke({ color: '#000000', width: 2 }), - text: displayText - }); + const styleText = new style.Text({ + font: '13px Calibri,sans-serif', + fill: new style.Fill({ color: '#ffffff' }), + stroke: new style.Stroke({ color: '#000000', width: 2 }), + text: displayText + }); - if (overrule) { - if (overrule.getFont()) styleText.setFont(overrule.getFont()); - if (overrule.getFill()) styleText.setFill(overrule.getFill()); - if (overrule.getStroke()) styleText.setStroke(overrule.getStroke()); + if (overrule) { + if (overrule.getFont()) styleText.setFont(overrule.getFont()); + if (overrule.getFill()) styleText.setFill(overrule.getFill()); + if (overrule.getStroke()) styleText.setStroke(overrule.getStroke()); + } + + return styleText; } - - return styleText; } }