diff --git a/src/Models/ThemeConfig/TagRenderingConfig.ts b/src/Models/ThemeConfig/TagRenderingConfig.ts index e2a4c1538d..153abe36c8 100644 --- a/src/Models/ThemeConfig/TagRenderingConfig.ts +++ b/src/Models/ThemeConfig/TagRenderingConfig.ts @@ -926,7 +926,7 @@ export default class TagRenderingConfig { * Might give undefined if setting to unknown is not possible */ public removeToSetUnknown(partOfLayer: LayerConfig, currentTags: Record): string[] | undefined { - if(!partOfLayer?.source || !currentTags){ + if (!partOfLayer?.source || !currentTags) { return } const toDelete = new Set() @@ -1001,12 +1001,17 @@ export class TagRenderingConfigUtils { // The original mappings get "priorityIf" set const oldMappingsCloned = clone.mappings?.map( - (m) => - { + (m) => { + const mapping = { ...m, - addExtraTags: [new Tag("nobrand", "")], priorityIf: m.priorityIf ?? TagUtils.Tag("id~*"), - }, + } + if (m.if.usedKeys().indexOf("nobrand") < 0) { + // Erase 'nobrand=yes', unless this option explicitly sets it + mapping["addExtraTags"] = [new Tag("nobrand", "")] + } + return mapping + }, ) ?? [] clone.mappings = [...oldMappingsCloned, ...extraMappings] return clone