forked from MapComplete/MapComplete
		
	Fix bug: allow custom themes without icon
This commit is contained in:
		
							parent
							
								
									cd0d275965
								
							
						
					
					
						commit
						b96fb595de
					
				
					 1 changed files with 8 additions and 1 deletions
				
			
		|  | @ -170,10 +170,13 @@ export default class DetermineLayout { | ||||||
|         if (json.layers === undefined && json.tagRenderings !== undefined) { |         if (json.layers === undefined && json.tagRenderings !== undefined) { | ||||||
|             // We got fed a layer instead of a theme
 |             // We got fed a layer instead of a theme
 | ||||||
|             const layerConfig = <LayerConfigJson>json |             const layerConfig = <LayerConfigJson>json | ||||||
|             const icon = Utils.NoNull( |             let icon = Utils.NoNull( | ||||||
|                 layerConfig.pointRendering |                 layerConfig.pointRendering | ||||||
|                     .flatMap((pr) => pr.marker) |                     .flatMap((pr) => pr.marker) | ||||||
|                     .map((iconSpec) => { |                     .map((iconSpec) => { | ||||||
|  |                         if(!iconSpec){ | ||||||
|  |                             return undefined | ||||||
|  |                         } | ||||||
|                         const icon = new TagRenderingConfig(<TagRenderingConfigJson>iconSpec.icon) |                         const icon = new TagRenderingConfig(<TagRenderingConfigJson>iconSpec.icon) | ||||||
|                             .render.txt |                             .render.txt | ||||||
|                         if ( |                         if ( | ||||||
|  | @ -189,6 +192,10 @@ export default class DetermineLayout { | ||||||
|                     }) |                     }) | ||||||
|             ).join(";") |             ).join(";") | ||||||
| 
 | 
 | ||||||
|  |             if(!icon){ | ||||||
|  |                 icon = "./assets/svg/bug.svg" | ||||||
|  |             } | ||||||
|  | 
 | ||||||
|             json = { |             json = { | ||||||
|                 id: json.id, |                 id: json.id, | ||||||
|                 description: json.description, |                 description: json.description, | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue