Fix rainbox theme and add improvements

This commit is contained in:
Pieter Vander Vennet 2022-07-12 10:23:45 +02:00
parent f0df09d0cb
commit 441d8467fe
8 changed files with 135 additions and 18 deletions

View file

@ -191,6 +191,9 @@ export default class LayerConfig extends WithContextLoader {
this.doNotDownload = json.doNotDownload ?? false;
this.passAllFeatures = json.passAllFeatures ?? false;
this.minzoom = json.minzoom ?? 0;
if(json["minZoom"] !== undefined){
throw "At "+context+": minzoom is written all lowercase"
}
this.minzoomVisible = json.minzoomVisible ?? this.minzoom;
this.shownByDefault = json.shownByDefault ?? true;
this.forceLoad = json.forceLoad ?? false;

View file

@ -364,7 +364,7 @@ export default class TagRenderingConfig {
* Returns true if it is known or not shown, false if the question should be asked
* @constructor
*/
public IsKnown(tags: any): boolean {
public IsKnown(tags: Record<string, string>): boolean {
if (this.condition &&
!this.condition.matchesProperties(tags)) {
// Filtered away by the condition, so it is kindof known
@ -400,7 +400,7 @@ export default class TagRenderingConfig {
* @param tags
* @constructor
*/
public GetRenderValues(tags: any): { then: Translation, icon?: string, iconClass?: string }[] {
public GetRenderValues(tags: Record<string, string>): { then: Translation, icon?: string, iconClass?: string }[] {
if (!this.multiAnswer) {
return [this.GetRenderValueWithImage(tags)]
}
@ -410,7 +410,7 @@ export default class TagRenderingConfig {
let freeformKeyDefined = this.freeform?.key !== undefined;
let usedFreeformValues = new Set<string>()
// We run over all the mappings first, to check if the mapping matches
const applicableMappings: { then: TypedTranslation<any>, img?: string }[] = Utils.NoNull((this.mappings ?? [])?.map(mapping => {
const applicableMappings: { then: TypedTranslation<Record<string, string>>, img?: string }[] = Utils.NoNull((this.mappings ?? [])?.map(mapping => {
if (mapping.if === undefined) {
return mapping;
}