AW1873Bouwplanlabels
FarmMaps.Develop/FarmMapsLib/pipeline/head This commit looks good Details

master
Peter Bastiani 2023-08-23 16:34:18 +02:00
parent 1d0f3b958d
commit c9c9a2ddbf
1 changed files with 13 additions and 3 deletions

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']
};
}