error TS1068: Unexpected token. A constructor, method, accessor, or property was expected.
All checks were successful
FarmMaps.Develop/FarmMapsLib/pipeline/head This commit looks good

This commit is contained in:
Peter Bastiani 2023-08-25 09:53:36 +02:00
parent 9849eaf1e7
commit 3fd4ac2f94

View File

@ -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) { 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); super(layer);
this._format = new GeoJSON(); this._format = new GeoJSON();
} }
geometry(feature: Feature<Geometry>) { geometry(feature: Feature<Geometry>) {
@ -149,7 +149,7 @@ export class ItemVectorSourceComponent extends SourceVectorComponent implements
fill: new style.Fill({ fill: new style.Fill({
color: fillColor color: fillColor
}), }),
geometry: (feature: Feature<Geometry>) => this.geometry(feature), geometry: (feature: Feature<Geometry>) => this.geometry(feature),
text: this.getDisplayTextForFeature(feature, this.map.instance.getView().getZoom()) text: this.getDisplayTextForFeature(feature, this.map.instance.getView().getZoom())
}); });
} else { } else {
@ -227,26 +227,27 @@ export class ItemVectorSourceComponent extends SourceVectorComponent implements
const centroid = getCenter(feature.getGeometry().getExtent()); const centroid = getCenter(feature.getGeometry().getExtent());
value = Math.round(centroid[0]) + ',' + Math.round(centroid[1]); 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({ const styleText = new style.Text({
font: '13px Calibri,sans-serif', font: '13px Calibri,sans-serif',
fill: new style.Fill({ color: '#ffffff' }), fill: new style.Fill({ color: '#ffffff' }),
stroke: new style.Stroke({ color: '#000000', width: 2 }), stroke: new style.Stroke({ color: '#000000', width: 2 }),
text: displayText text: displayText
}); });
if (overrule) { if (overrule) {
if (overrule.getFont()) styleText.setFont(overrule.getFont()); if (overrule.getFont()) styleText.setFont(overrule.getFont());
if (overrule.getFill()) styleText.setFill(overrule.getFill()); if (overrule.getFill()) styleText.setFill(overrule.getFill());
if (overrule.getStroke()) styleText.setStroke(overrule.getStroke()); if (overrule.getStroke()) styleText.setStroke(overrule.getStroke());
}
return styleText;
} }
return styleText;
} }
} }