Visualize attribution in the attribution panel

This commit is contained in:
Pieter Vander Vennet 2021-04-09 02:57:06 +02:00
parent a16745d0d1
commit 12d99e0323
10 changed files with 122 additions and 28 deletions

View file

@ -452,5 +452,23 @@ export default class LayerConfig {
};
}
public ExtractImages(): Set<string> {
const parts: Set<string>[] = []
parts.push(...this.tagRenderings?.map(tr => tr.ExtractImages(false)))
parts.push(...this.titleIcons?.map(tr => tr.ExtractImages(true)))
parts.push(this.icon?.ExtractImages(true))
parts.push(...this.iconOverlays?.map(overlay => overlay.then.ExtractImages(true)))
for (const preset of this.presets) {
parts.push(new Set<string>(preset.description?.ExtractImages(false)))
}
const allIcons = new Set<string>();
for (const part of parts) {
part?.forEach(allIcons.add, allIcons)
}
return allIcons;
}
}