2021-07-23 15:56:22 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								import  {  Translation  }  from  "../../UI/i18n/Translation"  
						 
					
						
							
								
									
										
										
										
											2021-03-20 23:45:52 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								import  SourceConfig  from  "./SourceConfig"  
						 
					
						
							
								
									
										
										
										
											2021-08-07 23:11:34 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								import  TagRenderingConfig  from  "./TagRenderingConfig"  
						 
					
						
							
								
									
										
										
										
											2021-12-04 21:49:17 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								import  PresetConfig ,  {  PreciseInput  }  from  "./PresetConfig"  
						 
					
						
							
								
									
										
										
										
											2021-08-07 23:11:34 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								import  {  LayerConfigJson  }  from  "./Json/LayerConfigJson"  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								import  Translations  from  "../../UI/i18n/Translations"  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								import  {  TagUtils  }  from  "../../Logic/Tags/TagUtils"  
						 
					
						
							
								
									
										
										
										
											2021-07-22 11:29:09 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								import  FilterConfig  from  "./FilterConfig"  
						 
					
						
							
								
									
										
										
										
											2021-08-07 23:11:34 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								import  {  Unit  }  from  "../Unit"  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								import  DeleteConfig  from  "./DeleteConfig"  
						 
					
						
							
								
									
										
										
										
											2021-10-14 03:46:09 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								import  MoveConfig  from  "./MoveConfig"  
						 
					
						
							
								
									
										
										
										
											2021-10-19 02:31:32 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								import  PointRenderingConfig  from  "./PointRenderingConfig"  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								import  WithContextLoader  from  "./WithContextLoader"  
						 
					
						
							
								
									
										
										
										
											2021-10-20 02:01:27 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								import  LineRenderingConfig  from  "./LineRenderingConfig"  
						 
					
						
							
								
									
										
										
										
											2021-10-22 18:53:07 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								import  {  TagRenderingConfigJson  }  from  "./Json/TagRenderingConfigJson"  
						 
					
						
							
								
									
										
										
										
											2021-11-08 02:36:01 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								import  Link  from  "../../UI/Base/Link"  
						 
					
						
							
								
									
										
										
										
											2021-11-08 03:00:58 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								import  {  Utils  }  from  "../../Utils"  
						 
					
						
							
								
									
										
										
										
											2022-01-14 19:34:00 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								import  {  TagsFilter  }  from  "../../Logic/Tags/TagsFilter"  
						 
					
						
							
								
									
										
										
										
											2022-02-01 04:14:54 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								import  FilterConfigJson  from  "./Json/FilterConfigJson"  
						 
					
						
							
								
									
										
										
										
											2022-03-24 19:59:46 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								import  {  Overpass  }  from  "../../Logic/Osm/Overpass"  
						 
					
						
							
								
									
										
										
										
											2023-04-02 02:59:20 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								import  Constants  from  "../Constants"  
						 
					
						
							
								
									
										
										
										
											2023-06-30 13:36:02 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								import  {  QuestionableTagRenderingConfigJson  }  from  "./Json/QuestionableTagRenderingConfigJson"  
						 
					
						
							
								
									
										
										
										
											2024-07-12 03:17:15 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								import  MarkdownUtils  from  "../../Utils/MarkdownUtils"  
						 
					
						
							
								
									
										
										
										
											2024-09-04 00:07:23 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								import  {  And  }  from  "../../Logic/Tags/And"  
						 
					
						
							
								
									
										
										
										
											2021-04-10 23:53:13 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2021-10-22 18:53:07 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								export  default  class  LayerConfig  extends  WithContextLoader  {  
						 
					
						
							
								
									
										
										
										
											2022-07-06 17:11:17 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    public  static  readonly  syncSelectionAllowed  =  [ "no" ,  "local" ,  "theme-only" ,  "global" ]  as  const 
							 
						 
					
						
							
								
									
										
										
										
											2021-12-04 21:49:17 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    public  readonly  id : string 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    public  readonly  name : Translation 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    public  readonly  description : Translation 
							 
						 
					
						
							
								
									
										
										
										
											2024-08-27 21:33:47 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    public  readonly  searchTerms : Record < string ,  string [ ] > 
							 
						 
					
						
							
								
									
										
										
										
											2023-03-24 19:21:15 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    / * * 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								     *  Only  'null'  for  special ,  privileged  layers 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								     * / 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    public  readonly  source : SourceConfig  |  null 
							 
						 
					
						
							
								
									
										
										
										
											2021-12-12 02:59:24 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    public  readonly  calculatedTags :  [ string ,  string ,  boolean ] [ ] 
							 
						 
					
						
							
								
									
										
										
										
											2021-12-04 21:49:17 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    public  readonly  doNotDownload : boolean 
							 
						 
					
						
							
								
									
										
										
										
											2022-01-14 19:34:00 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    public  readonly  passAllFeatures : boolean 
							 
						 
					
						
							
								
									
										
										
										
											2022-07-18 02:00:32 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    public  readonly  isShown : TagsFilter 
							 
						 
					
						
							
								
									
										
										
										
											2021-12-12 17:21:32 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    public  minzoom : number 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    public  minzoomVisible : number 
							 
						 
					
						
							
								
									
										
										
										
											2021-12-04 21:49:17 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    public  readonly  title? : TagRenderingConfig 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    public  readonly  titleIcons : TagRenderingConfig [ ] 
							 
						 
					
						
							
								
									
										
										
										
											2021-10-19 02:31:32 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    public  readonly  mapRendering : PointRenderingConfig [ ] 
							 
						 
					
						
							
								
									
										
										
										
											2021-10-20 02:01:27 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    public  readonly  lineRendering : LineRenderingConfig [ ] 
							 
						 
					
						
							
								
									
										
										
										
											2021-07-23 15:56:22 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    public  readonly  units : Unit [ ] 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    public  readonly  deletion : DeleteConfig  |  null 
							 
						 
					
						
							
								
									
										
										
										
											2021-10-14 03:46:09 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    public  readonly  allowMove : MoveConfig  |  null 
							 
						 
					
						
							
								
									
										
										
										
											2021-07-15 20:47:28 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    public  readonly  allowSplit : boolean 
							 
						 
					
						
							
								
									
										
										
										
											2021-12-03 02:29:25 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    public  readonly  shownByDefault : boolean 
							 
						 
					
						
							
								
									
										
										
										
											2024-02-22 01:39:42 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    public  readonly  doCount : boolean 
							 
						 
					
						
							
								
									
										
										
										
											2024-09-04 00:07:23 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    public  readonly  snapName? : Translation 
							 
						 
					
						
							
								
									
										
										
										
											2021-10-25 20:38:57 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    / * * 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								     *  In  seconds 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								     * / 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    public  readonly  maxAgeOfCache : number 
							 
						 
					
						
							
								
									
										
										
										
											2021-12-04 21:49:17 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    public  readonly  presets : PresetConfig [ ] 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    public  readonly  tagRenderings : TagRenderingConfig [ ] 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    public  readonly  filters : FilterConfig [ ] 
							 
						 
					
						
							
								
									
										
										
										
											2022-02-01 04:14:54 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    public  readonly  filterIsSameAs : string 
							 
						 
					
						
							
								
									
										
										
										
											2022-02-07 01:59:07 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    public  readonly  forceLoad : boolean 
							 
						 
					
						
							
								
									
										
										
										
											2023-06-14 20:44:01 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    public  readonly  syncSelection :  ( typeof  LayerConfig . syncSelectionAllowed ) [ number ]  // this is a trick to conver a constant array of strings into a type union of these values
 
							 
						 
					
						
							
								
									
										
										
										
											2022-09-08 21:40:48 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2023-06-01 02:52:21 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    public  readonly  _needsFullNodeDatabase : boolean 
							 
						 
					
						
							
								
									
										
										
										
											2024-04-12 15:03:45 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    public  readonly  popupInFloatover : boolean  |  string 
							 
						 
					
						
							
								
									
										
										
										
											2024-05-06 14:23:54 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    public  readonly  enableMorePrivacy : boolean 
							 
						 
					
						
							
								
									
										
										
										
											2023-03-26 05:58:28 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2025-01-02 03:56:42 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    public  readonly  baseTags : Readonly < Record < string ,  string > > 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2024-07-16 19:31:00 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    / * * 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								     *  If  this  layer  is  based  on  another  layer ,  this  might  be  indicated  here 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								     *  @private 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								     * / 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    private  readonly  _basedOn : string  |  undefined 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2025-01-18 00:30:06 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    constructor ( 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        json : LayerConfigJson , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        context? : string , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        official : boolean  =  true , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        allLayers? : LayerConfigJson [ ] 
							 
						 
					
						
							
								
									
										
										
										
											2025-01-08 16:18:55 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    )  { 
							 
						 
					
						
							
								
									
										
										
										
											2024-07-18 17:58:39 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        context  =  context  +  "."  +  json ? . id 
							 
						 
					
						
							
								
									
										
										
										
											2022-07-06 17:11:17 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        const  translationContext  =  "layers:"  +  json . id 
							 
						 
					
						
							
								
									
										
										
										
											2021-10-19 02:31:32 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        super ( json ,  context ) 
							 
						 
					
						
							
								
									
										
										
										
											2021-07-23 15:56:22 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        this . id  =  json . id 
							 
						 
					
						
							
								
									
										
										
										
											2024-07-16 19:31:00 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        this . _basedOn  =  json [ "_basedOn" ] 
							 
						 
					
						
							
								
									
										
										
										
											2021-10-25 20:38:57 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2023-03-25 02:48:24 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        if  ( json . source  ===  "special"  ||  json . source  ===  "special:library" )  { 
							 
						 
					
						
							
								
									
										
										
										
											2023-03-24 19:21:15 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								            this . source  =  null 
							 
						 
					
						
							
								
									
										
										
										
											2021-10-29 01:41:37 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        } 
							 
						 
					
						
							
								
									
										
										
										
											2021-07-23 15:56:22 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2022-06-13 03:13:42 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        this . syncSelection  =  json . syncSelection  ? ?  "no" 
							 
						 
					
						
							
								
									
										
										
										
											2024-10-19 14:44:55 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        if  ( ! json . source )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            if  ( json . presets  ===  undefined )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                throw  "Error while parsing "  +  json . id  +  " in "  +  context  +  "; no source given" 
							 
						 
					
						
							
								
									
										
										
										
											2024-08-23 02:33:25 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								            } 
							 
						 
					
						
							
								
									
										
										
										
											2024-08-16 02:09:54 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								            this . source  =  new  SourceConfig ( { 
							 
						 
					
						
							
								
									
										
										
										
											2024-10-19 14:44:55 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                osmTags : TagUtils.Tag ( {  or : json.presets.map ( ( pr )  = >  ( {  and : pr.tags  } ) )  } ) , 
							 
						 
					
						
							
								
									
										
										
										
											2024-08-16 02:09:54 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								            } ) 
							 
						 
					
						
							
								
									
										
										
										
											2024-08-23 13:13:41 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        }  else  if  ( typeof  json . source  !==  "string" )  { 
							 
						 
					
						
							
								
									
										
										
										
											2023-04-14 02:42:57 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								            this . maxAgeOfCache  =  json . source [ "maxCacheAge" ]  ? ?  24  *  60  *  60  *  30 
							 
						 
					
						
							
								
									
										
										
										
											2023-03-25 02:48:24 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								            this . source  =  new  SourceConfig ( 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                { 
							 
						 
					
						
							
								
									
										
										
										
											2023-10-13 18:46:56 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                    osmTags : TagUtils.Tag ( json . source [ "osmTags" ] ,  context  +  "source.osmTags" ) , 
							 
						 
					
						
							
								
									
										
										
										
											2023-03-25 02:48:24 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                    geojsonSource : json.source [ "geoJson" ] , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                    geojsonSourceLevel : json.source [ "geoJsonZoomLevel" ] , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                    overpassScript : json.source [ "overpassScript" ] , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                    isOsmCache : json.source [ "isOsmCache" ] , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                    mercatorCrs : json.source [ "mercatorCrs" ] , 
							 
						 
					
						
							
								
									
										
										
										
											2024-07-21 10:52:51 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                    idKey : json.source [ "idKey" ] , 
							 
						 
					
						
							
								
									
										
										
										
											2023-03-25 02:48:24 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                } , 
							 
						 
					
						
							
								
									
										
										
										
											2025-01-18 00:30:06 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                json . id 
							 
						 
					
						
							
								
									
										
										
										
											2022-09-08 21:40:48 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								            ) 
							 
						 
					
						
							
								
									
										
										
										
											2022-03-31 02:44:23 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        } 
							 
						 
					
						
							
								
									
										
										
										
											2022-07-06 17:11:17 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2021-10-19 02:31:32 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        this . allowSplit  =  json . allowSplit  ? ?  false 
							 
						 
					
						
							
								
									
										
										
										
											2022-04-01 12:51:55 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        this . name  =  Translations . T ( json . name ,  translationContext  +  ".name" ) 
							 
						 
					
						
							
								
									
										
										
										
											2024-09-04 00:07:23 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        this . snapName  =  Translations . T ( json . snapName ,  translationContext  +  ".snapName" ) 
							 
						 
					
						
							
								
									
										
										
										
											2021-10-19 02:31:32 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        if  ( json . description  !==  undefined )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            if  ( Object . keys ( json . description ) . length  ===  0 )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                json . description  =  undefined 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        } 
							 
						 
					
						
							
								
									
										
										
										
											2022-04-01 12:51:55 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        this . description  =  Translations . T ( json . description ,  translationContext  +  ".description" ) 
							 
						 
					
						
							
								
									
										
										
										
											2024-08-27 21:33:47 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        this . searchTerms  =  json . searchTerms  ? ?  { } 
							 
						 
					
						
							
								
									
										
										
										
											2021-10-19 02:31:32 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2021-07-23 15:56:22 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        this . calculatedTags  =  undefined 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        if  ( json . calculatedTags  !==  undefined )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            if  ( ! official )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                console . warn ( 
							 
						 
					
						
							
								
									
										
										
										
											2025-01-18 00:30:06 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                    ` Unofficial theme  ${ this . id }  with custom javascript! This is a security risk ` 
							 
						 
					
						
							
								
									
										
										
										
											2021-07-23 15:56:22 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                ) 
							 
						 
					
						
							
								
									
										
										
										
											2021-01-08 03:57:18 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								            } 
							 
						 
					
						
							
								
									
										
										
										
											2021-07-23 15:56:22 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								            this . calculatedTags  =  [ ] 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            for  ( const  kv  of  json . calculatedTags )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                const  index  =  kv . indexOf ( "=" ) 
							 
						 
					
						
							
								
									
										
										
										
											2022-04-23 15:20:54 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                let  key  =  kv . substring ( 0 ,  index ) . trim ( ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                const  r  =  "[a-z_][a-z0-9:]*" 
							 
						 
					
						
							
								
									
										
										
										
											2022-07-06 17:11:17 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                if  ( key . match ( r )  ===  null )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                    throw  ( 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                        "At "  + 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                        context  + 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                        " invalid key for calculated tag: "  + 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                        key  + 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                        "; it should match "  + 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                        r 
							 
						 
					
						
							
								
									
										
										
										
											2022-09-08 21:40:48 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                    ) 
							 
						 
					
						
							
								
									
										
										
										
											2022-04-23 15:20:54 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                } 
							 
						 
					
						
							
								
									
										
										
										
											2021-12-12 02:59:24 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                const  isStrict  =  key . endsWith ( ":" ) 
							 
						 
					
						
							
								
									
										
										
										
											2022-01-14 19:34:00 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                if  ( isStrict )  { 
							 
						 
					
						
							
								
									
										
										
										
											2021-12-12 02:59:24 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                    key  =  key . substr ( 0 ,  key . length  -  1 ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                } 
							 
						 
					
						
							
								
									
										
										
										
											2021-07-23 15:56:22 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                const  code  =  kv . substring ( index  +  1 ) 
							 
						 
					
						
							
								
									
										
										
										
											2021-01-08 03:57:18 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2021-12-12 02:59:24 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                this . calculatedTags . push ( [ key ,  code ,  isStrict ] ) 
							 
						 
					
						
							
								
									
										
										
										
											2020-10-27 01:01:34 +01:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								            } 
							 
						 
					
						
							
								
									
										
										
										
											2021-07-23 15:56:22 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        } 
							 
						 
					
						
							
								
									
										
										
										
											2021-01-08 03:57:18 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2021-07-23 15:56:22 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        this . doNotDownload  =  json . doNotDownload  ? ?  false 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        this . passAllFeatures  =  json . passAllFeatures  ? ?  false 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        this . minzoom  =  json . minzoom  ? ?  0 
							 
						 
					
						
							
								
									
										
										
										
											2023-06-01 02:52:21 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        this . _needsFullNodeDatabase  =  json . fullNodeDatabase  ? ?  false 
							 
						 
					
						
							
								
									
										
										
										
											2022-07-16 03:57:13 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        if  ( json [ "minZoom" ]  !==  undefined )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            throw  "At "  +  context  +  ": minzoom is written all lowercase" 
							 
						 
					
						
							
								
									
										
										
										
											2022-07-12 10:23:45 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        } 
							 
						 
					
						
							
								
									
										
										
										
											2024-11-25 02:06:28 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        this . minzoomVisible  =  json . minzoomVisible  ? ?  100 
							 
						 
					
						
							
								
									
										
										
										
											2021-12-03 02:29:25 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        this . shownByDefault  =  json . shownByDefault  ? ?  true 
							 
						 
					
						
							
								
									
										
										
										
											2024-03-28 03:05:21 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        this . doCount  =  json . isCounted  ? ?  this . shownByDefault  ? ?  true 
							 
						 
					
						
							
								
									
										
										
										
											2022-02-07 01:59:07 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        this . forceLoad  =  json . forceLoad  ? ?  false 
							 
						 
					
						
							
								
									
										
										
										
											2024-05-06 14:23:54 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        this . enableMorePrivacy  =  json . enableMorePrivacy  ? ?  false 
							 
						 
					
						
							
								
									
										
										
										
											2022-09-12 10:32:19 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        if  ( json . presets  ===  null )  json . presets  =  undefined 
							 
						 
					
						
							
								
									
										
										
										
											2021-10-14 03:46:09 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        if  ( json . presets  !==  undefined  &&  json . presets ? . map  ===  undefined )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            throw  "Presets should be a list of items (at "  +  context  +  ")" 
							 
						 
					
						
							
								
									
										
										
										
											2021-09-22 20:44:53 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        } 
							 
						 
					
						
							
								
									
										
										
										
											2021-07-14 00:17:15 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        this . presets  =  ( json . presets  ? ?  [ ] ) . map ( ( pr ,  i )  = >  { 
							 
						 
					
						
							
								
									
										
										
										
											2021-12-04 21:49:17 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								            let  preciseInput : PreciseInput  =  { 
							 
						 
					
						
							
								
									
										
										
										
											2021-10-16 00:43:53 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                preferredBackground :  [ "photo" ] , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                snapToLayers : undefined , 
							 
						 
					
						
							
								
									
										
										
										
											2024-07-21 10:52:51 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                maxSnapDistance : undefined , 
							 
						 
					
						
							
								
									
										
										
										
											2021-10-15 19:58:02 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								            } 
							 
						 
					
						
							
								
									
										
										
										
											2023-06-20 01:52:15 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								            if  ( pr [ "preciseInput" ]  !==  undefined )  { 
							 
						 
					
						
							
								
									
										
										
										
											2023-10-19 12:51:44 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                throw  ( 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                    "Layer "  + 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                    this . id  + 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                    " still uses the old 'preciseInput'-field. For snapping to layers, use 'snapToLayer' instead" 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                ) 
							 
						 
					
						
							
								
									
										
										
										
											2023-06-20 01:52:15 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								            } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            if  ( pr . snapToLayer  !==  undefined )  { 
							 
						 
					
						
							
								
									
										
										
										
											2025-04-28 15:09:17 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                const  snapToLayers  =  pr . snapToLayer 
							 
						 
					
						
							
								
									
										
										
										
											2021-08-07 21:19:01 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                preciseInput  =  { 
							 
						 
					
						
							
								
									
										
										
										
											2021-12-04 21:49:17 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                    snapToLayers , 
							 
						 
					
						
							
								
									
										
										
										
											2024-07-21 10:52:51 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                    maxSnapDistance : pr.maxSnapDistance  ? ?  10 , 
							 
						 
					
						
							
								
									
										
										
										
											2021-07-14 00:17:15 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            } 
							 
						 
					
						
							
								
									
										
										
										
											2021-08-07 23:11:34 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2025-05-03 12:59:18 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								            if  ( ! Array . isArray ( pr . tags ) )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                throw  context  +  ": Preset "  +  i  +  " tags are not an array" 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2025-05-03 23:48:35 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								            if  ( pr . tags . some ( ( t )  = >  typeof  t  !==  "string" ) )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                throw  ( 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                    context  + 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                    ": Preset "  + 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                    i  + 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                    ": all tags should be a simple tag (thus: a string) which should also be uploadable. A non-string type is found" 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                ) 
							 
						 
					
						
							
								
									
										
										
										
											2025-05-03 12:59:18 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								            } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2021-08-07 23:11:34 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								            const  config : PresetConfig  =  { 
							 
						 
					
						
							
								
									
										
										
										
											2022-04-01 12:51:55 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                title : Translations.T ( pr . title ,  ` ${ translationContext } .presets. ${ i } .title ` ) , 
							 
						 
					
						
							
								
									
										
										
										
											2021-08-07 23:11:34 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                tags : pr.tags.map ( ( t )  = >  TagUtils . SimpleTag ( t ) ) , 
							 
						 
					
						
							
								
									
										
										
										
											2022-04-01 12:51:55 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                description : Translations.T ( 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                    pr . description , 
							 
						 
					
						
							
								
									
										
										
										
											2025-01-18 00:30:06 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                    ` ${ translationContext } .presets. ${ i } .description ` 
							 
						 
					
						
							
								
									
										
										
										
											2022-04-01 12:51:55 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                ) , 
							 
						 
					
						
							
								
									
										
										
										
											2021-08-07 21:19:01 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                preciseInput : preciseInput , 
							 
						 
					
						
							
								
									
										
										
										
											2024-07-21 10:52:51 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                exampleImages : pr.exampleImages , 
							 
						 
					
						
							
								
									
										
										
										
											2021-07-24 02:32:33 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								            } 
							 
						 
					
						
							
								
									
										
										
										
											2021-08-07 21:19:01 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								            return  config 
							 
						 
					
						
							
								
									
										
										
										
											2021-07-24 02:32:33 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        } ) 
							 
						 
					
						
							
								
									
										
										
										
											2021-07-23 15:56:22 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2023-09-19 14:04:13 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        if  ( json . pointRendering  ===  undefined  &&  json . lineRendering  ===  undefined )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            throw  "Both pointRendering and lineRendering are undefined in "  +  context 
							 
						 
					
						
							
								
									
										
										
										
											2021-10-21 01:26:20 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        } 
							 
						 
					
						
							
								
									
										
										
										
											2021-09-09 20:26:12 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2023-09-19 14:04:13 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        if  ( json . lineRendering )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            this . lineRendering  =  Utils . NoNull ( json . lineRendering ) . map ( 
							 
						 
					
						
							
								
									
										
										
										
											2025-01-18 00:30:06 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                ( r ,  i )  = >  new  LineRenderingConfig ( r ,  ` ${ context } [ ${ i } ] ` ) 
							 
						 
					
						
							
								
									
										
										
										
											2023-09-19 14:04:13 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								            ) 
							 
						 
					
						
							
								
									
										
										
										
											2021-11-09 18:22:05 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        }  else  { 
							 
						 
					
						
							
								
									
										
										
										
											2023-09-19 14:04:13 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								            this . lineRendering  =  [ ] 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        } 
							 
						 
					
						
							
								
									
										
										
										
											2021-10-20 02:01:27 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2023-09-19 14:04:13 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        if  ( json . pointRendering )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            this . mapRendering  =  Utils . NoNull ( json . pointRendering ) . map ( 
							 
						 
					
						
							
								
									
										
										
										
											2025-01-18 00:30:06 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                ( r ,  i )  = >  new  PointRenderingConfig ( r ,  ` ${ context } [ ${ i } ]( ${ this . id } ) ` ) 
							 
						 
					
						
							
								
									
										
										
										
											2023-09-19 14:04:13 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								            ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        }  else  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            this . mapRendering  =  [ ] 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        } 
							 
						 
					
						
							
								
									
										
										
										
											2022-09-08 21:40:48 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2023-09-19 14:04:13 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        { 
							 
						 
					
						
							
								
									
										
										
										
											2021-11-09 18:22:05 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								            const  hasCenterRendering  =  this . mapRendering . some ( 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                ( r )  = > 
							 
						 
					
						
							
								
									
										
										
										
											2022-12-16 13:45:07 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                    r . location . has ( "centroid" )  || 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                    r . location . has ( "projected_centerpoint" )  || 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                    r . location . has ( "start" )  || 
							 
						 
					
						
							
								
									
										
										
										
											2025-01-18 00:30:06 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                    r . location . has ( "end" ) 
							 
						 
					
						
							
								
									
										
										
										
											2022-09-08 21:40:48 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								            ) 
							 
						 
					
						
							
								
									
										
										
										
											2021-11-09 18:22:05 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2023-09-19 14:04:13 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								            if  ( 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                json . pointRendering  !==  null  && 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                json . lineRendering  !==  null  && 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                this . lineRendering . length  ===  0  && 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                this . mapRendering . length  ===  0 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            )  { 
							 
						 
					
						
							
								
									
										
										
										
											2021-11-09 18:22:05 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                throw  ( 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                    "The layer "  + 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                    this . id  + 
							 
						 
					
						
							
								
									
										
										
										
											2023-10-06 23:56:50 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                    `  does not have any maprenderings defined and will thus not show up on the map at all:
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								\ t  $ { this . lineRendering ? . length }  linerenderings  and  $ { this . mapRendering ? . length }  pointRenderings .  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								\ t  If  this  is  intentional ,  set  \ ` pointRendering \`  and  \` lineRendering \`  to 'null' instead of '[]' `  
						 
					
						
							
								
									
										
										
										
											2021-11-09 18:22:05 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                ) 
							 
						 
					
						
							
								
									
										
										
										
											2022-01-21 03:57:49 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								            }  else  if  ( 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                ! hasCenterRendering  && 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                this . lineRendering . length  ===  0  && 
							 
						 
					
						
							
								
									
										
										
										
											2025-02-07 01:37:36 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                ! Constants . isPriviliged ( this )  && 
							 
						 
					
						
							
								
									
										
										
										
											2023-09-19 14:04:13 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                this . source  !==  null  /*library layer*/  && 
							 
						 
					
						
							
								
									
										
										
										
											2023-04-02 02:59:20 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                ! this . source ? . geojsonSource ? . startsWith ( 
							 
						 
					
						
							
								
									
										
										
										
											2025-01-18 00:30:06 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                    "https://api.openstreetmap.org/api/0.6/notes.json" 
							 
						 
					
						
							
								
									
										
										
										
											2022-09-08 21:40:48 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                ) 
							 
						 
					
						
							
								
									
										
										
										
											2022-01-21 03:57:49 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								            )  { 
							 
						 
					
						
							
								
									
										
										
										
											2022-03-24 19:59:46 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                throw  ( 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                    "The layer "  + 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                    this . id  + 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                    " might not render ways. This might result in dropped information (at "  + 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                    context  + 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                    ")" 
							 
						 
					
						
							
								
									
										
										
										
											2022-09-08 21:40:48 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                ) 
							 
						 
					
						
							
								
									
										
										
										
											2021-11-09 18:22:05 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								            } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        } 
							 
						 
					
						
							
								
									
										
										
										
											2021-10-20 02:01:27 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2022-01-18 18:12:24 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        const  missingIds  = 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            Utils . NoNull ( json . tagRenderings ) ? . filter ( 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                ( tr )  = > 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                    typeof  tr  !==  "string"  && 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                    tr [ "builtin" ]  ===  undefined  && 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                    tr [ "id" ]  ===  undefined  && 
							 
						 
					
						
							
								
									
										
										
										
											2025-01-18 00:30:06 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                    tr [ "rewrite" ]  ===  undefined 
							 
						 
					
						
							
								
									
										
										
										
											2022-01-18 18:12:24 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								            )  ? ?  [ ] 
							 
						 
					
						
							
								
									
										
										
										
											2021-11-08 03:00:58 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        if  ( missingIds ? . length  >  0  &&  official )  { 
							 
						 
					
						
							
								
									
										
										
										
											2025-05-03 23:48:35 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								            const  msg  =  ` Context:  ${ context } ; Some tagRenderings of  ${ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                this . id 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            }  are  missing  an  id : $ { missingIds . map ( ( x )  = >  JSON . stringify ( x ) ) . join ( ", " ) }  ` 
 
							 
						 
					
						
							
								
									
										
										
										
											2025-04-28 15:09:17 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								            console . error ( msg ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            throw  msg 
							 
						 
					
						
							
								
									
										
										
										
											2021-10-14 03:46:09 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2022-01-18 18:12:24 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        this . tagRenderings  =  ( Utils . NoNull ( json . tagRenderings )  ? ?  [ ] ) . map ( 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            ( tr ,  i )  = > 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                new  TagRenderingConfig ( 
							 
						 
					
						
							
								
									
										
										
										
											2023-06-30 13:36:02 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                    < QuestionableTagRenderingConfigJson > tr , 
							 
						 
					
						
							
								
									
										
										
										
											2025-01-18 00:30:06 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                    this . id  +  ".tagRenderings["  +  i  +  "]" 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                ) 
							 
						 
					
						
							
								
									
										
										
										
											2022-09-08 21:40:48 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        ) 
							 
						 
					
						
							
								
									
										
										
										
											2024-04-28 22:13:25 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        if  ( json . units  !==  undefined  &&  ! Array . isArray ( json . units ) )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            throw  ( 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                "At "  + 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                context  + 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                ".units: the 'units'-section should be a list; you probably have an object there" 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        } 
							 
						 
					
						
							
								
									
										
										
										
											2024-06-19 01:11:54 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        this . units  =  ( json . units  ? ?  [ ] ) . flatMap ( ( unitJson ,  i )  = > 
							 
						 
					
						
							
								
									
										
										
										
											2025-01-18 00:30:06 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								            Unit . fromJson ( unitJson ,  this . tagRenderings ,  ` ${ context } .unit[ ${ i } ] ` ) 
							 
						 
					
						
							
								
									
										
										
										
											2024-04-28 22:13:25 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        ) 
							 
						 
					
						
							
								
									
										
										
										
											2025-01-08 16:18:55 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            let  filter  =  json . filter 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2025-01-18 00:30:06 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								            while  ( filter  !==  undefined  &&  filter  !==  null  &&  filter [ "sameAs" ]  !==  undefined )  { 
							 
						 
					
						
							
								
									
										
										
										
											2025-01-08 16:18:55 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                const  targetLayerName  =  filter [ "sameAs" ] 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                this . filterIsSameAs  =  targetLayerName 
							 
						 
					
						
							
								
									
										
										
										
											2025-01-18 00:30:06 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                const  targetLayer  =  allLayers ? . find ( ( l )  = >  l . id  ===  targetLayerName ) 
							 
						 
					
						
							
								
									
										
										
										
											2025-01-08 16:56:55 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                if  ( allLayers  &&  ! targetLayer )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                    throw  "Target layer "  +  targetLayerName  +  " not found in this theme" 
							 
						 
					
						
							
								
									
										
										
										
											2025-01-08 16:18:55 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                filter  =  targetLayer ? . filter 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            } 
							 
						 
					
						
							
								
									
										
										
										
											2021-11-08 03:00:58 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2022-02-01 04:14:54 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								            this . filters  =  [ ] 
							 
						 
					
						
							
								
									
										
										
										
											2025-01-08 16:18:55 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								            { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                this . filters  =  ( < FilterConfigJson [ ] > filter  ? ?  [ ] ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                    . filter ( ( f )  = >  typeof  f  !==  "string" ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                    . map ( ( option ,  i )  = >  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                        return  new  FilterConfig ( option ,  ` layers: ${ this . id } .filter. ${ i } ` ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                    } ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            } 
							 
						 
					
						
							
								
									
										
										
										
											2022-02-01 04:14:54 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        } 
							 
						 
					
						
							
								
									
										
										
										
											2021-10-14 03:46:09 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2021-11-08 03:00:58 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        { 
							 
						 
					
						
							
								
									
										
										
										
											2023-09-24 00:25:10 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								            const  duplicateIds  =  Utils . Duplicates ( this . filters . map ( ( f )  = >  f . id ) ) 
							 
						 
					
						
							
								
									
										
										
										
											2021-11-08 03:00:58 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								            if  ( duplicateIds . length  >  0 )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                throw  ` Some filters have a duplicate id:  ${ duplicateIds }  (at  ${ context } .filters) ` 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2021-10-14 03:46:09 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        if  ( json [ "filters" ]  !==  undefined )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            throw  "Error in "  +  context  +  ": use 'filter' instead of 'filters'" 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        } 
							 
						 
					
						
							
								
									
										
										
										
											2021-07-23 15:56:22 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2022-09-27 18:53:53 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        this . titleIcons  =  this . ParseTagRenderings ( < TagRenderingConfigJson [ ] > json . titleIcons  ? ?  [ ] ,  { 
							 
						 
					
						
							
								
									
										
										
										
											2024-07-21 10:52:51 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								            readOnlyMode : true , 
							 
						 
					
						
							
								
									
										
										
										
											2022-09-08 21:40:48 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        } ) 
							 
						 
					
						
							
								
									
										
										
										
											2020-11-16 01:59:30 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2023-05-30 23:45:30 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        this . title  =  this . tr ( "title" ,  undefined ,  translationContext ) 
							 
						 
					
						
							
								
									
										
										
										
											2022-07-18 02:00:32 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        this . isShown  =  TagUtils . TagD ( json . isShown ,  context  +  ".isShown" ) 
							 
						 
					
						
							
								
									
										
										
										
											2021-10-22 18:53:07 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2021-07-23 15:56:22 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        this . deletion  =  null 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        if  ( json . deletion  ===  true )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            json . deletion  =  { } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        if  ( json . deletion  !==  undefined  &&  json . deletion  !==  false )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            this . deletion  =  new  DeleteConfig ( json . deletion ,  ` ${ context } .deletion ` ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        } 
							 
						 
					
						
							
								
									
										
										
										
											2021-03-15 16:23:04 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2021-10-14 03:46:09 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        this . allowMove  =  null 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        if  ( json . allowMove  ===  false )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            this . allowMove  =  null 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        }  else  if  ( json . allowMove  ===  true )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            this . allowMove  =  new  MoveConfig ( { } ,  context  +  ".allowMove" ) 
							 
						 
					
						
							
								
									
										
										
										
											2022-12-23 16:39:01 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        }  else  if  ( json . allowMove  !==  undefined )  { 
							 
						 
					
						
							
								
									
										
										
										
											2021-10-14 03:46:09 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								            this . allowMove  =  new  MoveConfig ( json . allowMove ,  context  +  ".allowMove" ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2021-07-23 15:56:22 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        if  ( json [ "showIf" ]  !==  undefined )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            throw  ( 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                "Invalid key on layerconfig "  + 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                this . id  + 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                ": showIf. Did you mean 'isShown' instead?" 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        } 
							 
						 
					
						
							
								
									
										
										
										
											2023-05-05 01:00:15 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        this . popupInFloatover  =  json . popupInFloatover  ? ?  false 
							 
						 
					
						
							
								
									
										
										
										
											2025-01-02 03:56:42 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        this . baseTags  =  TagUtils . changeAsProperties ( 
							 
						 
					
						
							
								
									
										
										
										
											2025-01-18 00:30:06 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								            this . source ? . osmTags ? . asChange ( {  id :  "node/-1"  } )  ? ?  [ {  k :  "id" ,  v :  "node/-1"  } ] 
							 
						 
					
						
							
								
									
										
										
										
											2025-01-02 03:56:42 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        ) 
							 
						 
					
						
							
								
									
										
										
										
											2021-01-08 03:57:18 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2025-01-02 03:56:42 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    public  hasDefaultIcon() { 
							 
						 
					
						
							
								
									
										
										
										
											2021-11-11 17:14:03 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        if  ( this . mapRendering  ===  undefined  ||  this . mapRendering  ===  null )  { 
							 
						 
					
						
							
								
									
										
										
										
											2025-01-02 03:56:42 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								            return  false 
							 
						 
					
						
							
								
									
										
										
										
											2021-10-31 02:08:39 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        } 
							 
						 
					
						
							
								
									
										
										
										
											2025-01-02 03:56:42 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        return  this . mapRendering . some ( ( r )  = >  r . location . has ( "point" ) ) 
							 
						 
					
						
							
								
									
										
										
										
											2022-02-09 22:37:21 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    } 
							 
						 
					
						
							
								
									
										
										
										
											2025-01-08 16:18:55 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2025-04-10 04:52:38 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    / * * 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								     *  A  quick  overview  table  of  all  the  elements  in  the  popup - box 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								     *  @private 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								     * / 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    private  generateDocumentationQuickTable ( ) :  string  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        return  MarkdownUtils . table ( 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            [ "id" ,  "question" ,  "labels" ,  "freeform key" ] , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            this . tagRenderings 
							 
						 
					
						
							
								
									
										
										
										
											2025-04-15 18:18:44 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                . filter ( ( tr )  = >  tr . labels . indexOf ( "ignore_docs" )  <  0 ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                . map ( ( tr )  = >  { 
							 
						 
					
						
							
								
									
										
										
										
											2025-04-10 04:52:38 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                    let  key  =  "_Multiple choice only_" 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                    if  ( tr . freeform )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                        const  type  =  ` [ ${ tr . freeform . type } ](../SpecialInputElements.md# ${ tr . freeform . type } ) ` 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                        key  =  ` *[ ${ tr . freeform . key } ](https://wiki.osm.org/wiki/Key: ${ tr . freeform . key } )* ( ${ type } ) ` 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                    } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                    let  origDef  =  "" 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                    if  ( tr . _definedIn )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                        let  [ layer ,  id ]  =  tr . _definedIn 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                        if  ( layer  ==  "questions" )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                            layer  =  "./BuiltinQuestions" 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                        }  else  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                            layer  =  "./"  +  layer 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                        } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                        origDef  =  ` <br/> _(Original in [ ${ tr . _definedIn [ 0 ] } ]( ${ layer } .md# ${ id } ))_ ` 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                    } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                    const  q  =  tr . question ? . Subs ( this . baseTags ) ? . txt ? . trim ( ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                    let  r  =  tr . render ? . txt 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                    if  ( r  &&  r  !==  "" )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                        r  =  ` _ ${ r } _ ` 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                    } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                    let  options : string  =  undefined 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                    if  ( tr . mappings ? . length  >  0 )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                        options  =  ` ${ tr . mappings . length }  options ` 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                    } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                    return  [ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                        ` [ ${ tr . id } ](# ${ tr . id } )  ${ origDef } ` , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                        Utils . NoNull ( [ q ,  r ,  options ] ) . join ( "<br/>" ) , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                        tr . labels . join ( ", " ) , 
							 
						 
					
						
							
								
									
										
										
										
											2025-04-15 18:18:44 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                        key , 
							 
						 
					
						
							
								
									
										
										
										
											2025-04-10 04:52:38 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                    ] 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                } ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2025-02-10 02:13:07 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    public  generateDocumentation ( 
							 
						 
					
						
							
								
									
										
										
										
											2025-06-13 02:39:27 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        {  usedInThemes  =  [ ] ,  layerIsNeededBy ,  dependencies  =  [ ] ,  addedByDefault  =  false ,  canBeIncluded  =  true ,  lang  =  "en" ,  reusedTagRenderings  } :  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            usedInThemes? : string [ ] , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            layerIsNeededBy? : Map < string ,  string [ ] > , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            dependencies ? :  {  context? : string ;  reason : string ;  neededLayer : string  } [ ] , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            addedByDefault? : boolean , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            canBeIncluded? : boolean , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            reusedTagRenderings? : Map < string ,  { layer :  string } [ ] > , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            lang? : string 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        } 
							 
						 
					
						
							
								
									
										
										
										
											2024-07-12 03:17:15 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    ) :  string  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        const  extraProps : string [ ]  =  [ ] 
							 
						 
					
						
							
								
									
										
										
										
											2022-07-06 17:11:17 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        extraProps . push ( "This layer is shown at zoomlevel **"  +  this . minzoom  +  "** and higher" ) 
							 
						 
					
						
							
								
									
										
										
										
											2021-11-08 02:36:01 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        if  ( canBeIncluded )  { 
							 
						 
					
						
							
								
									
										
										
										
											2021-11-09 18:22:05 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								            if  ( addedByDefault )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                extraProps . push ( 
							 
						 
					
						
							
								
									
										
										
										
											2025-01-18 00:30:06 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                    "**This layer is included automatically in every theme. This layer might contain no points**" 
							 
						 
					
						
							
								
									
										
										
										
											2021-11-09 18:22:05 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                ) 
							 
						 
					
						
							
								
									
										
										
										
											2021-11-08 14:18:45 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								            } 
							 
						 
					
						
							
								
									
										
										
										
											2022-01-14 19:34:00 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								            if  ( this . shownByDefault  ===  false )  { 
							 
						 
					
						
							
								
									
										
										
										
											2021-12-07 18:18:24 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                extraProps . push ( 
							 
						 
					
						
							
								
									
										
										
										
											2025-01-18 00:30:06 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                    "This layer is not visible by default and must be enabled in the filter by the user. " 
							 
						 
					
						
							
								
									
										
										
										
											2021-12-07 18:18:24 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            } 
							 
						 
					
						
							
								
									
										
										
										
											2021-11-08 02:36:01 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								            if  ( this . title  ===  undefined )  { 
							 
						 
					
						
							
								
									
										
										
										
											2022-07-20 14:39:19 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                extraProps . push ( 
							 
						 
					
						
							
								
									
										
										
										
											2025-01-18 00:30:06 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                    "Elements don't have a title set and cannot be toggled nor will they show up in the dashboard. If you import this layer in your theme, override `title` to make this toggleable." 
							 
						 
					
						
							
								
									
										
										
										
											2022-07-20 14:39:19 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                ) 
							 
						 
					
						
							
								
									
										
										
										
											2021-12-07 18:18:24 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								            } 
							 
						 
					
						
							
								
									
										
										
										
											2022-07-20 14:39:19 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								            if  ( this . name  ===  undefined  &&  this . shownByDefault  ===  false )  { 
							 
						 
					
						
							
								
									
										
										
										
											2021-12-07 18:18:24 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                extraProps . push ( 
							 
						 
					
						
							
								
									
										
										
										
											2025-01-18 00:30:06 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                    "This layer is not visible by default and the visibility cannot be toggled, effectively resulting in a fully hidden layer. This can be useful, e.g. to calculate some metatags. If you want to render this layer (e.g. for debugging), enable it by setting the URL-parameter layer-<id>=true" 
							 
						 
					
						
							
								
									
										
										
										
											2021-12-07 18:18:24 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                ) 
							 
						 
					
						
							
								
									
										
										
										
											2021-11-08 02:36:01 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								            } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            if  ( this . name  ===  undefined )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                extraProps . push ( 
							 
						 
					
						
							
								
									
										
										
										
											2025-01-18 00:30:06 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                    "Not visible in the layer selection by default. If you want to make this layer toggable, override `name`" 
							 
						 
					
						
							
								
									
										
										
										
											2021-11-08 02:36:01 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            if  ( this . mapRendering . length  ===  0 )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                extraProps . push ( 
							 
						 
					
						
							
								
									
										
										
										
											2025-01-18 00:30:06 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                    "Not rendered on the map by default. If you want to rendering this on the map, override `mapRenderings`" 
							 
						 
					
						
							
								
									
										
										
										
											2021-11-08 02:36:01 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            } 
							 
						 
					
						
							
								
									
										
										
										
											2022-01-14 19:34:00 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2023-04-15 03:15:17 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								            if  ( this . source ? . geojsonSource  !==  undefined )  { 
							 
						 
					
						
							
								
									
										
										
										
											2022-07-16 03:57:13 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                extraProps . push ( 
							 
						 
					
						
							
								
									
										
										
										
											2024-07-12 03:17:15 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                    [ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                        "<img src='../warning.svg' height='1rem'/>" , 
							 
						 
					
						
							
								
									
										
										
										
											2022-07-16 03:57:13 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                        "This layer is loaded from an external source, namely " , 
							 
						 
					
						
							
								
									
										
										
										
											2024-07-21 10:52:51 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                        "`"  +  this . source . geojsonSource  +  "`" , 
							 
						 
					
						
							
								
									
										
										
										
											2025-01-18 00:30:06 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                    ] . join ( "\n\n" ) 
							 
						 
					
						
							
								
									
										
										
										
											2022-09-08 21:40:48 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                ) 
							 
						 
					
						
							
								
									
										
										
										
											2022-01-14 19:34:00 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								            } 
							 
						 
					
						
							
								
									
										
										
										
											2021-11-08 02:36:01 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        }  else  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            extraProps . push ( 
							 
						 
					
						
							
								
									
										
										
										
											2025-01-18 00:30:06 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                "This layer can **not** be included in a theme. It is solely used by [special renderings](SpecialRenderings.md) showing a minimap with custom data." 
							 
						 
					
						
							
								
									
										
										
										
											2021-11-08 02:36:01 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								            ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2024-07-12 03:17:15 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        let  usingLayer : string [ ]  =  [ ] 
							 
						 
					
						
							
								
									
										
										
										
											2024-02-28 02:04:51 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        if  ( ! addedByDefault )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            if  ( usedInThemes ? . length  >  0 )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                usingLayer  =  [ 
							 
						 
					
						
							
								
									
										
										
										
											2024-07-12 03:17:15 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                    "## Themes using this layer" , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                    MarkdownUtils . list ( 
							 
						 
					
						
							
								
									
										
										
										
											2025-01-18 00:30:06 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                        ( usedInThemes  ? ?  [ ] ) . map ( ( id )  = >  ` [ ${ id } ](https://mapcomplete.org/ ${ id } ) ` ) 
							 
						 
					
						
							
								
									
										
										
										
											2024-07-21 10:52:51 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                    ) , 
							 
						 
					
						
							
								
									
										
										
										
											2024-02-28 02:04:51 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                ] 
							 
						 
					
						
							
								
									
										
										
										
											2024-04-13 02:40:21 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								            }  else  if  ( this . source  !==  null )  { 
							 
						 
					
						
							
								
									
										
										
										
											2024-07-12 03:17:15 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                usingLayer  =  [ "No themes use this layer" ] 
							 
						 
					
						
							
								
									
										
										
										
											2024-02-28 02:04:51 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								            } 
							 
						 
					
						
							
								
									
										
										
										
											2021-11-08 02:36:01 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2021-12-05 02:06:14 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        for  ( const  dep  of  dependencies )  { 
							 
						 
					
						
							
								
									
										
										
										
											2022-01-14 19:34:00 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								            extraProps . push ( 
							 
						 
					
						
							
								
									
										
										
										
											2024-07-12 03:17:15 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                [ 
							 
						 
					
						
							
								
									
										
										
										
											2022-01-14 19:34:00 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                    "This layer will automatically load " , 
							 
						 
					
						
							
								
									
										
										
										
											2024-07-21 10:52:51 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                    ` [ ${ dep . neededLayer } ](./ ${ dep . neededLayer } .md) ` , 
							 
						 
					
						
							
								
									
										
										
										
											2022-01-14 19:34:00 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                    " into the layout as it depends on it: " , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                    dep . reason , 
							 
						 
					
						
							
								
									
										
										
										
											2024-07-21 10:52:51 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                    "("  +  dep . context  +  ")" , 
							 
						 
					
						
							
								
									
										
										
										
											2025-01-18 00:30:06 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                ] . join ( " " ) 
							 
						 
					
						
							
								
									
										
										
										
											2022-09-08 21:40:48 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								            ) 
							 
						 
					
						
							
								
									
										
										
										
											2021-12-05 02:06:14 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        } 
							 
						 
					
						
							
								
									
										
										
										
											2022-01-14 19:34:00 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2024-09-04 00:07:23 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        let  presets : string [ ]  =  [ ] 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        if  ( this . presets . length  >  0 )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            presets  =  [ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                "## Presets" , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                "The following options to create new points are included:" , 
							 
						 
					
						
							
								
									
										
										
										
											2024-10-19 14:44:55 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                MarkdownUtils . list ( 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                    this . presets . map ( ( preset )  = >  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                        let  snaps  =  "" 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                        if  ( preset . preciseInput ? . snapToLayers )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                            snaps  = 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                                " (snaps to layers "  + 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                                preset . preciseInput . snapToLayers 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                                    . map ( ( id )  = >  ` \` ${ id } \` ` ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                                    . join ( ", " )  + 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                                ")" 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                        } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                        return  ( 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                            "**"  + 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                            preset . title . txt  + 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                            "** which has the following tags:"  + 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                            new  And ( preset . tags ) . asHumanString ( true )  + 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                            snaps 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                        ) 
							 
						 
					
						
							
								
									
										
										
										
											2025-01-18 00:30:06 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                    } ) 
							 
						 
					
						
							
								
									
										
										
										
											2024-10-19 14:44:55 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                ) , 
							 
						 
					
						
							
								
									
										
										
										
											2024-09-04 00:07:23 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								            ] 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2022-03-24 19:59:46 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        for  ( const  revDep  of  Utils . Dedup ( layerIsNeededBy ? . get ( this . id )  ? ?  [ ] ) )  { 
							 
						 
					
						
							
								
									
										
										
										
											2022-01-14 19:34:00 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								            extraProps . push ( 
							 
						 
					
						
							
								
									
										
										
										
											2024-07-21 10:52:51 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                [ "This layer is needed as dependency for layer" ,  ` [ ${ revDep } ](# ${ revDep } ) ` ] . join ( 
							 
						 
					
						
							
								
									
										
										
										
											2025-01-18 00:30:06 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                    " " 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                ) 
							 
						 
					
						
							
								
									
										
										
										
											2022-09-08 21:40:48 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								            ) 
							 
						 
					
						
							
								
									
										
										
										
											2022-01-14 19:34:00 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2024-07-12 03:17:15 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        const  tableRows : string [ ] [ ]  =  Utils . NoNull ( 
							 
						 
					
						
							
								
									
										
										
										
											2022-01-14 19:34:00 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								            this . tagRenderings 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                . map ( ( tr )  = >  tr . FreeformValues ( ) ) 
							 
						 
					
						
							
								
									
										
										
										
											2024-07-21 10:52:51 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                . filter ( ( values )  = >  values  !==  undefined ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                . filter ( ( values )  = >  values . key  !==  "id" ) 
							 
						 
					
						
							
								
									
										
										
										
											2022-01-14 19:34:00 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                . map ( ( values )  = >  { 
							 
						 
					
						
							
								
									
										
										
										
											2024-07-21 10:52:51 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                    const  embedded : string [ ]  =  values . values ? . map ( ( v )  = > 
							 
						 
					
						
							
								
									
										
										
										
											2025-01-18 00:30:06 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                        Link . OsmWiki ( values . key ,  v ,  true ) . SetClass ( "mr-2" ) . AsMarkdown ( ) 
							 
						 
					
						
							
								
									
										
										
										
											2022-07-16 03:57:13 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                    )  ? ?  [ "_no preset options defined, or no values in them_" ] 
							 
						 
					
						
							
								
									
										
										
										
											2024-07-21 10:52:51 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                    const  statistics  =  ` https://taghistory.raifer.tech/?#***/ ${ encodeURIComponent ( 
							 
						 
					
						
							
								
									
										
										
										
											2025-01-18 00:30:06 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                        values . key 
							 
						 
					
						
							
								
									
										
										
										
											2024-07-21 10:52:51 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                    ) } / ` 
 
							 
						 
					
						
							
								
									
										
										
										
											2024-07-16 19:31:00 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                    const  tagInfo  =  ` https://taginfo.openstreetmap.org/keys/ ${ values . key } #values ` 
							 
						 
					
						
							
								
									
										
										
										
											2022-01-14 19:34:00 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                    return  [ 
							 
						 
					
						
							
								
									
										
										
										
											2024-07-12 03:17:15 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                        [ 
							 
						 
					
						
							
								
									
										
										
										
											2024-07-16 19:31:00 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                            ` <a target="_blank" href=' ${ tagInfo } '><img src='https://mapcomplete.org/assets/svg/search.svg' height='18px'></a> ` , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                            ` <a target="_blank" href=' ${ statistics } '><img src='https://mapcomplete.org/assets/svg/statistics.svg' height='18px'></a> ` , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2024-07-21 10:52:51 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                            Link . OsmWiki ( values . key ) . AsMarkdown ( ) , 
							 
						 
					
						
							
								
									
										
										
										
											2024-07-12 03:17:15 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                        ] . join ( " " ) , 
							 
						 
					
						
							
								
									
										
										
										
											2022-01-14 19:34:00 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                        values . type  ===  undefined 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                            ?  "Multiple choice" 
							 
						 
					
						
							
								
									
										
										
										
											2024-07-12 03:17:15 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                            :  ` [ ${ values . type } ](../SpecialInputElements.md# ${ values . type } ) ` , 
							 
						 
					
						
							
								
									
										
										
										
											2024-07-21 10:52:51 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                        embedded . join ( " " ) , 
							 
						 
					
						
							
								
									
										
										
										
											2022-01-14 19:34:00 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                    ] 
							 
						 
					
						
							
								
									
										
										
										
											2025-01-18 00:30:06 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                } ) 
							 
						 
					
						
							
								
									
										
										
										
											2022-09-08 21:40:48 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2024-07-12 03:17:15 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        let  quickOverview : string [ ]  =  [ ] 
							 
						 
					
						
							
								
									
										
										
										
											2022-01-14 19:34:00 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        if  ( tableRows . length  >  0 )  { 
							 
						 
					
						
							
								
									
										
										
										
											2024-07-12 03:17:15 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								            quickOverview  =  [ 
							 
						 
					
						
							
								
									
										
										
										
											2025-04-10 04:52:38 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                "**Warning:**: this quick overview is incomplete" , 
							 
						 
					
						
							
								
									
										
										
										
											2024-07-12 03:17:15 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                MarkdownUtils . table ( 
							 
						 
					
						
							
								
									
										
										
										
											2022-07-16 03:57:13 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                    [ "attribute" ,  "type" ,  "values which are supported by this layer" ] , 
							 
						 
					
						
							
								
									
										
										
										
											2025-01-18 00:30:06 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                    tableRows 
							 
						 
					
						
							
								
									
										
										
										
											2024-07-21 10:52:51 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                ) , 
							 
						 
					
						
							
								
									
										
										
										
											2024-07-12 03:17:15 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								            ] 
							 
						 
					
						
							
								
									
										
										
										
											2021-12-04 21:49:17 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2024-07-12 03:17:15 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        let  overpassLink : string  =  undefined 
							 
						 
					
						
							
								
									
										
										
										
											2023-03-25 02:48:24 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        if  ( this . source  !==  undefined )  { 
							 
						 
					
						
							
								
									
										
										
										
											2022-03-24 19:59:46 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								            try  { 
							 
						 
					
						
							
								
									
										
										
										
											2024-07-21 10:52:51 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                overpassLink  = 
							 
						 
					
						
							
								
									
										
										
										
											2024-07-12 03:17:15 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                    "[Execute on overpass]("  + 
							 
						 
					
						
							
								
									
										
										
										
											2023-11-13 03:16:24 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                    Overpass . AsOverpassTurboLink ( < TagsFilter > this . source . osmTags . optimize ( ) ) 
							 
						 
					
						
							
								
									
										
										
										
											2023-11-13 01:39:32 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                        . replaceAll ( "(" ,  "%28" ) 
							 
						 
					
						
							
								
									
										
										
										
											2024-07-21 10:52:51 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                        . replaceAll ( ")" ,  "%29" )  + 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                    ")" 
							 
						 
					
						
							
								
									
										
										
										
											2022-03-24 19:59:46 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								            }  catch  ( e )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                console . error ( "Could not generate overpasslink for "  +  this . id ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2024-07-21 10:52:51 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        const  filterDocs : string [ ]  =  [ ] 
							 
						 
					
						
							
								
									
										
										
										
											2022-12-16 13:45:07 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        if  ( this . filters . length  >  0 )  { 
							 
						 
					
						
							
								
									
										
										
										
											2024-07-16 19:31:00 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								            filterDocs . push ( "## Filters" ) 
							 
						 
					
						
							
								
									
										
										
										
											2022-12-16 13:45:07 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								            filterDocs . push ( . . . this . filters . map ( ( filter )  = >  filter . GenerateDocs ( ) ) ) 
							 
						 
					
						
							
								
									
										
										
										
											2022-12-06 03:41:54 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        } 
							 
						 
					
						
							
								
									
										
										
										
											2023-04-20 18:58:31 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2024-07-12 03:17:15 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        const  tagsDescription : string [ ]  =  [ ] 
							 
						 
					
						
							
								
									
										
										
										
											2023-11-13 01:39:32 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        if  ( this . source  !==  null )  { 
							 
						 
					
						
							
								
									
										
										
										
											2024-07-12 03:17:15 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								            tagsDescription . push ( "## Basic tags for this layer" ) 
							 
						 
					
						
							
								
									
										
										
										
											2023-11-13 03:16:24 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            const  neededTags  =  < TagsFilter > this . source . osmTags . optimize ( ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            if  ( neededTags [ "and" ] )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                const  parts  =  neededTags [ "and" ] 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                tagsDescription . push ( 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                    "Elements must match **all** of the following expressions:" , 
							 
						 
					
						
							
								
									
										
										
										
											2025-01-18 00:30:06 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                    parts . map ( ( p ,  i )  = >  i  +  ". "  +  p . asHumanString ( true ,  false ,  { } ) ) . join ( "\n" ) 
							 
						 
					
						
							
								
									
										
										
										
											2023-11-13 03:16:24 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            }  else  if  ( neededTags [ "or" ] )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                const  parts  =  neededTags [ "or" ] 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                tagsDescription . push ( 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                    "Elements must match **any** of the following expressions:" , 
							 
						 
					
						
							
								
									
										
										
										
											2025-01-18 00:30:06 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                    parts . map ( ( p )  = >  " - "  +  p . asHumanString ( true ,  false ,  { } ) ) . join ( "\n" ) 
							 
						 
					
						
							
								
									
										
										
										
											2023-11-13 03:16:24 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            }  else  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                tagsDescription . push ( 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                    "Elements must match the expression **"  + 
							 
						 
					
						
							
								
									
										
										
										
											2025-01-18 00:30:06 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                        neededTags . asHumanString ( true ,  false ,  { } )  + 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                        "**" 
							 
						 
					
						
							
								
									
										
										
										
											2023-11-13 03:16:24 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            tagsDescription . push ( overpassLink ) 
							 
						 
					
						
							
								
									
										
										
										
											2023-04-20 18:58:31 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        }  else  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            tagsDescription . push ( "This is a special layer - data is not sourced from OpenStreetMap" ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2024-07-12 03:17:15 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        return  [ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            [ 
							 
						 
					
						
							
								
									
										
										
										
											2024-07-16 19:31:00 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                "# "  +  this . id  +  "\n" , 
							 
						 
					
						
							
								
									
										
										
										
											2024-07-21 10:52:51 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                this . _basedOn 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                    ?  ` This layer is based on [ ${ this . _basedOn } ](../Layers/ ${ this . _basedOn } .md) ` 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                    :  "" , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                this . description , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                "\n" , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            ] . join ( "\n\n" ) , 
							 
						 
					
						
							
								
									
										
										
										
											2024-07-12 03:17:15 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								            MarkdownUtils . list ( extraProps ) , 
							 
						 
					
						
							
								
									
										
										
										
											2022-01-14 19:34:00 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								            . . . usingLayer , 
							 
						 
					
						
							
								
									
										
										
										
											2024-09-04 00:07:23 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								            . . . presets , 
							 
						 
					
						
							
								
									
										
										
										
											2023-04-20 18:58:31 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								            . . . tagsDescription , 
							 
						 
					
						
							
								
									
										
										
										
											2024-07-12 03:17:15 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								            "## Supported attributes" , 
							 
						 
					
						
							
								
									
										
										
										
											2025-04-10 04:52:38 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								            . . . quickOverview , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            "## Featureview elements and TagRenderings" , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            this . generateDocumentationQuickTable ( ) , 
							 
						 
					
						
							
								
									
										
										
										
											2024-07-16 19:31:00 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								            . . . this . tagRenderings 
							 
						 
					
						
							
								
									
										
										
										
											2024-07-21 10:52:51 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                . filter ( ( tr )  = >  tr . labels . indexOf ( "ignore_docs" )  <  0 ) 
							 
						 
					
						
							
								
									
										
										
										
											2025-06-13 02:39:27 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                . map ( ( tr )  = >  tr . generateDocumentation ( lang ,  reusedTagRenderings ? . get ( tr . id ) ? . map ( l  = >  l . layer ) ) ) , 
							 
						 
					
						
							
								
									
										
										
										
											2024-07-21 10:52:51 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								            . . . filterDocs , 
							 
						 
					
						
							
								
									
										
										
										
											2024-07-16 19:31:00 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        ] . join ( "\n\n" ) 
							 
						 
					
						
							
								
									
										
										
										
											2021-11-08 02:36:01 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2021-07-23 15:56:22 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    public  CustomCodeSnippets ( ) :  string [ ]  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        if  ( this . calculatedTags  ===  undefined )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            return  [ ] 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        return  this . calculatedTags . map ( ( code )  = >  code [ 1 ] ) 
							 
						 
					
						
							
								
									
										
										
										
											2021-07-22 11:29:09 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    } 
							 
						 
					
						
							
								
									
										
										
										
											2022-01-14 19:34:00 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    AllTagRenderings ( ) :  TagRenderingConfig [ ]  { 
							 
						 
					
						
							
								
									
										
										
										
											2022-07-18 02:00:32 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        return  Utils . NoNull ( [ . . . this . tagRenderings ,  . . . this . titleIcons ,  this . title ] ) 
							 
						 
					
						
							
								
									
										
										
										
											2022-01-14 19:34:00 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    } 
							 
						 
					
						
							
								
									
										
										
										
											2021-01-08 03:57:18 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2021-10-22 18:53:07 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    public  isLeftRightSensitive ( ) :  boolean  { 
							 
						 
					
						
							
								
									
										
										
										
											2021-10-22 14:01:40 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        return  this . lineRendering . some ( ( lr )  = >  lr . leftRightSensitive ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    } 
							 
						 
					
						
							
								
									
										
										
										
											2024-09-04 00:07:23 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    public  getMostMatchingPreset ( tags : Record < string ,  string > ) :  PresetConfig  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        const  presets  =  this . presets 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        if  ( ! presets )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            return  undefined 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        } 
							 
						 
					
						
							
								
									
										
										
										
											2024-10-19 14:44:55 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        const  matchingPresets  =  presets . filter ( ( pr )  = >  new  And ( pr . tags ) . matchesProperties ( tags ) ) 
							 
						 
					
						
							
								
									
										
										
										
											2024-09-04 00:07:23 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        let  mostShadowed  =  matchingPresets [ 0 ] 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        let  mostShadowedTags  =  new  And ( mostShadowed . tags ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        for  ( let  i  =  1 ;  i  <  matchingPresets . length ;  i ++ )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            const  pr  =  matchingPresets [ i ] 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            const  prTags  =  new  And ( pr . tags ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            if  ( mostShadowedTags . shadows ( prTags ) )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                if  ( ! prTags . shadows ( mostShadowedTags ) )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                    // We have a new most shadowed item
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                    mostShadowed  =  pr 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                    mostShadowedTags  =  prTags 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                }  else  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                    // Both shadow each other: abort
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                    mostShadowed  =  undefined 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                    break 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            }  else  if  ( ! prTags . shadows ( mostShadowedTags ) )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                // The new contender does not win, but it might defeat the current contender
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                mostShadowed  =  undefined 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                break 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        return  mostShadowed  ? ?  matchingPresets [ 0 ] 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    } 
							 
						 
					
						
							
								
									
										
										
										
											2024-09-11 01:46:55 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2024-09-15 02:22:31 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    / * * 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								     *  Indicates  if  this  is  a  normal  layer ,  meaning  that  it  can  be  toggled  by  the  user  in  normal  circumstances 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								     *  Thus : name  is  set ,  not  a  note  import  layer ,  not  synced  with  another  filter ,  . . . 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								     * / 
							 
						 
					
						
							
								
									
										
										
										
											2024-10-19 14:44:55 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    public  isNormal() { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        if  ( this . id . startsWith ( "note_import" ) )  { 
							 
						 
					
						
							
								
									
										
										
										
											2024-09-11 01:46:55 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								            return  false 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2024-10-19 14:44:55 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        if  ( Constants . added_by_default . indexOf ( < any > this . id )  >=  0 )  { 
							 
						 
					
						
							
								
									
										
										
										
											2024-09-11 01:46:55 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								            return  false 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        } 
							 
						 
					
						
							
								
									
										
										
										
											2024-10-19 14:44:55 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        if  ( this . filterIsSameAs  !==  undefined )  { 
							 
						 
					
						
							
								
									
										
										
										
											2024-09-11 01:46:55 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								            return  false 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        } 
							 
						 
					
						
							
								
									
										
										
										
											2024-10-19 14:44:55 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        if  ( ! this . name )  { 
							 
						 
					
						
							
								
									
										
										
										
											2024-09-15 02:22:31 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								            return  false 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        } 
							 
						 
					
						
							
								
									
										
										
										
											2024-09-11 01:46:55 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        return  true 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    } 
							 
						 
					
						
							
								
									
										
										
										
											2021-08-07 23:11:34 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								}