Add option to force loading of a layer, even if it is hidden + automatically set this flag is another layer depends on this layer

This commit is contained in:
Pieter Vander Vennet 2022-02-07 01:59:07 +01:00
parent ad2f7b2bd6
commit 0f95891a47
6 changed files with 28 additions and 7 deletions

View file

@ -60,6 +60,7 @@ export default class LayerConfig extends WithContextLoader {
public readonly tagRenderings: TagRenderingConfig[];
public readonly filters: FilterConfig[];
public readonly filterIsSameAs: string;
public readonly forceLoad: boolean;
constructor(
json: LayerConfigJson,
@ -166,6 +167,7 @@ export default class LayerConfig extends WithContextLoader {
this.minzoom = json.minzoom ?? 0;
this.minzoomVisible = json.minzoomVisible ?? this.minzoom;
this.shownByDefault = json.shownByDefault ?? true;
this.forceLoad = json.forceLoad ?? false;
if (json.presets !== undefined && json.presets?.map === undefined) {
throw "Presets should be a list of items (at " + context + ")"
}