forked from MapComplete/MapComplete
		
	Improve feedback on backroundlayer.id
This commit is contained in:
		
							parent
							
								
									0161119167
								
							
						
					
					
						commit
						6a08c28dca
					
				
					 1 changed files with 3 additions and 1 deletions
				
			
		|  | @ -277,9 +277,11 @@ export class ValidateTheme extends DesugaringStep<LayoutConfigJson> { | ||||||
|                 backgroundId === "photo" || backgroundId === "map" || backgroundId === "osmbasedmap" |                 backgroundId === "photo" || backgroundId === "map" || backgroundId === "osmbasedmap" | ||||||
| 
 | 
 | ||||||
|             if (!isCategory && !ValidateTheme._availableLayers.has(backgroundId)) { |             if (!isCategory && !ValidateTheme._availableLayers.has(backgroundId)) { | ||||||
|  |                 const options = Array.from(ValidateTheme._availableLayers) | ||||||
|  |                 const nearby = Utils.sortedByLevenshteinDistance(backgroundId, options, t => t) | ||||||
|                 context |                 context | ||||||
|                     .enter("defaultBackgroundId") |                     .enter("defaultBackgroundId") | ||||||
|                     .err("This layer ID is not known: " + backgroundId) |                     .err(`This layer ID is not known: ${backgroundId}. Perhaps you meant one of ${nearby.slice(0,5).join(", ")}`) | ||||||
|             } |             } | ||||||
|         } |         } | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue