AW1873Bouwplanlabels
All checks were successful
FarmMaps.Develop/FarmMapsLib/pipeline/head This commit looks good

This commit is contained in:
Peter (extern) 2023-08-23 16:34:18 +02:00
parent 1d0f3b958d
commit c9c9a2ddbf

View File

@ -42,7 +42,7 @@ export class ItemVectorSourceComponent extends SourceVectorComponent implements
@Output() onFeatureHover: EventEmitter<Feature<Geometry>> = new EventEmitter<Feature<Geometry>>();
private stylesCache: IStyles = {};
private sub: Subscription;
private displayMapFeatureSettings: { [code: string]: string[] };
private displayMapFeatureSettings: { [code: string]: string[] } = defaultDisplayMapFeatureSettings();
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);
@ -85,10 +85,13 @@ export class ItemVectorSourceComponent extends SourceVectorComponent implements
userSettingsRoot => {
this.itemService.getChildItemList(userSettingsRoot.code, 'vnd.farmmaps.itemtype.settings.general').subscribe(
items => {
this.displayMapFeatureSettings = items && items.length > 0 ? items[0].data?.displayMapFeatureSettings : null;
if (items && items.length > 0 && items[0].data?.displayMapFeatureSettings) {
this.displayMapFeatureSettings = items[0].data?.displayMapFeatureSettings;
}
}
)
});
}
);
this.strategy = loadingstrategy.bbox;
this.format = new GeoJSON();
this._select = new Select({
@ -241,4 +244,11 @@ export class ItemVectorSourceComponent extends SourceVectorComponent implements
return styleText;
}
}
function defaultDisplayMapFeatureSettings() {
return {
'vnd.farmmaps.itemtype.cropfield': ['name', 'cropTypeName', 'area'],
'vnd.farmmaps.itemtype.croppingscheme': ['name']
};
}