Usertests: add 'centermessage' again which indicates if data is loading or is present, see #1457

This commit is contained in:
Pieter Vander Vennet 2023-06-15 02:42:12 +02:00
parent a55b84dba1
commit 1e56eb5503
8 changed files with 544 additions and 375 deletions

View file

@ -70,6 +70,8 @@ export default class LayoutConfig implements LayoutInformation {
public readonly definedAtUrl?: string
public readonly definitionRaw?: string
private readonly layersDict: Map<string, LayerConfig>
constructor(
json: LayoutConfigJson,
official = true,
@ -209,6 +211,11 @@ export default class LayoutConfig implements LayoutInformation {
this.overpassTimeout = json.overpassTimeout ?? 30
this.overpassMaxZoom = json.overpassMaxZoom ?? 16
this.osmApiTileSize = json.osmApiTileSize ?? this.overpassMaxZoom + 1
this.layersDict = new Map<string, LayerConfig>()
for (const layer of this.layers) {
this.layersDict.set(layer.id, layer)
}
}
public CustomCodeSnippets(): string[] {
@ -228,6 +235,10 @@ export default class LayoutConfig implements LayoutInformation {
return custom
}
public getLayer(id: string) {
return this.layersDict.get(id)
}
public isLeftRightSensitive() {
return this.layers.some((l) => l.isLeftRightSensitive())
}