Add LayerIndex convenience function

This commit is contained in:
pietervdvn 2021-04-25 13:23:27 +02:00
parent 0aad17e63c
commit 591ab349a6

View file

@ -211,6 +211,14 @@ export default class LayoutConfig {
return icons return icons
} }
public LayerIndex() : Map<string, LayerConfig>{
const index = new Map<string, LayerConfig>();
for (const layer of this.layers) {
index.set(layer.id, layer)
}
return index;
}
/** /**
* Replaces all the relative image-urls with a fixed image url * Replaces all the relative image-urls with a fixed image url
* This is to fix loading from external sources * This is to fix loading from external sources