forked from MapComplete/MapComplete
		
	Fix: nobrand= is actually applied when using the Name suggestion index
This commit is contained in:
		
							parent
							
								
									89a20ca1af
								
							
						
					
					
						commit
						c3bb0cb837
					
				
					 1 changed files with 10 additions and 5 deletions
				
			
		| 
						 | 
					@ -926,7 +926,7 @@ export default class TagRenderingConfig {
 | 
				
			||||||
     * Might give undefined if setting to unknown is not possible
 | 
					     * Might give undefined if setting to unknown is not possible
 | 
				
			||||||
     */
 | 
					     */
 | 
				
			||||||
    public removeToSetUnknown(partOfLayer: LayerConfig, currentTags: Record<string, string>): string[] | undefined {
 | 
					    public removeToSetUnknown(partOfLayer: LayerConfig, currentTags: Record<string, string>): string[] | undefined {
 | 
				
			||||||
        if(!partOfLayer?.source || !currentTags){
 | 
					        if (!partOfLayer?.source || !currentTags) {
 | 
				
			||||||
            return
 | 
					            return
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        const toDelete = new Set<string>()
 | 
					        const toDelete = new Set<string>()
 | 
				
			||||||
| 
						 | 
					@ -1001,11 +1001,16 @@ export class TagRenderingConfigUtils {
 | 
				
			||||||
            // The original mappings get "priorityIf" set
 | 
					            // The original mappings get "priorityIf" set
 | 
				
			||||||
            const oldMappingsCloned =
 | 
					            const oldMappingsCloned =
 | 
				
			||||||
                clone.mappings?.map(
 | 
					                clone.mappings?.map(
 | 
				
			||||||
                    (m) =>
 | 
					                    (m) => {
 | 
				
			||||||
                        <Mapping>{
 | 
					                        const mapping = {
 | 
				
			||||||
                            ...m,
 | 
					                            ...m,
 | 
				
			||||||
                            addExtraTags: [new Tag("nobrand", "")],
 | 
					 | 
				
			||||||
                            priorityIf: m.priorityIf ?? TagUtils.Tag("id~*"),
 | 
					                            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>mapping
 | 
				
			||||||
                    },
 | 
					                    },
 | 
				
			||||||
                ) ?? []
 | 
					                ) ?? []
 | 
				
			||||||
            clone.mappings = [...oldMappingsCloned, ...extraMappings]
 | 
					            clone.mappings = [...oldMappingsCloned, ...extraMappings]
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue