forked from MapComplete/MapComplete
		
	Wrap osmTag into an 'and' by default
This commit is contained in:
		
							parent
							
								
									6e93ab0be6
								
							
						
					
					
						commit
						6023f6e36c
					
				
					 1 changed files with 6 additions and 0 deletions
				
			
		|  | @ -19,6 +19,7 @@ import {PrepareLayer} from "../Models/ThemeConfig/Conversion/PrepareLayer"; | ||||||
| import {PrepareTheme} from "../Models/ThemeConfig/Conversion/PrepareTheme"; | import {PrepareTheme} from "../Models/ThemeConfig/Conversion/PrepareTheme"; | ||||||
| import {DesugaringContext} from "../Models/ThemeConfig/Conversion/Conversion"; | import {DesugaringContext} from "../Models/ThemeConfig/Conversion/Conversion"; | ||||||
| import {Utils} from "../Utils"; | import {Utils} from "../Utils"; | ||||||
|  | import {And} from "../Logic/Tags/And"; | ||||||
| 
 | 
 | ||||||
| // This scripts scans 'assets/layers/*.json' for layer definition files and 'assets/themes/*.json' for theme definition files.
 | // This scripts scans 'assets/layers/*.json' for layer definition files and 'assets/themes/*.json' for theme definition files.
 | ||||||
| // It spits out an overview of those to be used to load them
 | // It spits out an overview of those to be used to load them
 | ||||||
|  | @ -204,6 +205,11 @@ class LayerOverviewUtils { | ||||||
|         for (const sharedLayerJson of layerFiles) { |         for (const sharedLayerJson of layerFiles) { | ||||||
|             const context = "While building builtin layer " + sharedLayerJson.path |             const context = "While building builtin layer " + sharedLayerJson.path | ||||||
|             const fixed = prepLayer.convertStrict(sharedLayerJson.parsed, context) |             const fixed = prepLayer.convertStrict(sharedLayerJson.parsed, context) | ||||||
|  |              | ||||||
|  |             if(fixed.source.osmTags["and"] === undefined){ | ||||||
|  |                 fixed.source.osmTags = {"and": [fixed.source.osmTags]} | ||||||
|  |             } | ||||||
|  |              | ||||||
|             const validator = new ValidateLayer(sharedLayerJson.path, true, knownImagePaths); |             const validator = new ValidateLayer(sharedLayerJson.path, true, knownImagePaths); | ||||||
|             validator.convertStrict(fixed, context) |             validator.convertStrict(fixed, context) | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue