| 
									
										
										
										
											2023-03-28 05:13:48 +02:00
										 |  |  | <script lang="ts"> | 
					
						
							|  |  |  |   import type { Feature } from "geojson"; | 
					
						
							| 
									
										
										
										
											2023-03-29 17:21:20 +02:00
										 |  |  |   import { UIEventSource } from "../../Logic/UIEventSource"; | 
					
						
							| 
									
										
										
										
											2023-03-28 05:13:48 +02:00
										 |  |  |   import LayerConfig from "../../Models/ThemeConfig/LayerConfig"; | 
					
						
							|  |  |  |   import type { SpecialVisualizationState } from "../SpecialVisualization"; | 
					
						
							| 
									
										
										
										
											2023-03-31 03:28:11 +02:00
										 |  |  |   import TagRenderingAnswer from "../Popup/TagRendering/TagRenderingAnswer.svelte"; | 
					
						
							|  |  |  |   import TagRenderingEditable from "../Popup/TagRendering/TagRenderingEditable.svelte"; | 
					
						
							|  |  |  |   import { onDestroy } from "svelte"; | 
					
						
							| 
									
										
										
										
											2023-04-20 17:42:07 +02:00
										 |  |  |   import Translations from "../i18n/Translations"; | 
					
						
							|  |  |  |   import Tr from "../Base/Tr.svelte"; | 
					
						
							| 
									
										
										
										
											2023-03-28 05:13:48 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-04-07 02:13:57 +02:00
										 |  |  |   export let state: SpecialVisualizationState; | 
					
						
							| 
									
										
										
										
											2023-03-29 17:21:20 +02:00
										 |  |  |   export let layer: LayerConfig; | 
					
						
							| 
									
										
										
										
											2023-04-07 02:13:57 +02:00
										 |  |  |   export let selectedElement: Feature; | 
					
						
							| 
									
										
										
										
											2023-03-29 17:21:20 +02:00
										 |  |  |   export let tags: UIEventSource<Record<string, string>>; | 
					
						
							| 
									
										
										
										
											2023-04-07 02:13:57 +02:00
										 |  |  |   export let highlightedRendering: UIEventSource<string> = undefined; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-03-28 05:13:48 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-03-31 03:28:11 +02:00
										 |  |  |   let _tags: Record<string, string>; | 
					
						
							|  |  |  |   onDestroy(tags.addCallbackAndRun(tags => { | 
					
						
							|  |  |  |     _tags = tags; | 
					
						
							|  |  |  |   })); | 
					
						
							| 
									
										
										
										
											2023-04-21 17:37:36 +02:00
										 |  |  |   console.log(layer.titleIcons.map(tr => tr.id)); | 
					
						
							| 
									
										
										
										
											2023-04-20 17:42:07 +02:00
										 |  |  | 
 | 
					
						
							|  |  |  |   let _metatags: Record<string, string>; | 
					
						
							|  |  |  |   onDestroy(state.userRelatedState.preferencesAsTags.addCallbackAndRun(tags => { | 
					
						
							| 
									
										
										
										
											2023-04-15 02:28:24 +02:00
										 |  |  |     _metatags = tags; | 
					
						
							|  |  |  |   })); | 
					
						
							| 
									
										
										
										
											2023-03-28 05:13:48 +02:00
										 |  |  | </script> | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-04-20 17:42:07 +02:00
										 |  |  | {#if _tags._deleted === "yes"} | 
					
						
							|  |  |  |   <Tr t={ Translations.t.delete.isDeleted} /> | 
					
						
							|  |  |  | {:else} | 
					
						
							|  |  |  |   <div> | 
					
						
							|  |  |  |     <div class="flex flex-col sm:flex-row flex-grow justify-between"> | 
					
						
							|  |  |  |       <!-- Title element--> | 
					
						
							|  |  |  |       <h3> | 
					
						
							|  |  |  |         <TagRenderingAnswer config={layer.title} {selectedElement} {state} {tags} {layer}></TagRenderingAnswer> | 
					
						
							|  |  |  |       </h3> | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |       <div class="flex flex-row flex-wrap pt-0.5 sm:pt-1 items-center mr-2"> | 
					
						
							| 
									
										
										
										
											2023-04-21 17:37:36 +02:00
										 |  |  |         {#each layer.titleIcons as titleIconConfig} | 
					
						
							|  |  |  |           {#if titleIconConfig.IsKnown(_tags)} | 
					
						
							|  |  |  |             <div class="w-8 h-8"> | 
					
						
							|  |  |  |               <TagRenderingAnswer config={titleIconConfig} {tags} {selectedElement} {state} | 
					
						
							|  |  |  |                                   {layer}></TagRenderingAnswer> | 
					
						
							|  |  |  |             </div> | 
					
						
							|  |  |  |           {/if} | 
					
						
							| 
									
										
										
										
											2023-04-20 17:42:07 +02:00
										 |  |  |         {/each} | 
					
						
							|  |  |  |       </div> | 
					
						
							| 
									
										
										
										
											2023-03-28 05:13:48 +02:00
										 |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-04-20 17:42:07 +02:00
										 |  |  |     </div> | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     <div class="flex flex-col"> | 
					
						
							|  |  |  |       {#each layer.tagRenderings as config (config.id)} | 
					
						
							|  |  |  |         {#if (config.condition === undefined || config.condition.matchesProperties(_tags)) && (config.metacondition === undefined || config.metacondition.matchesProperties({ ..._tags, ..._metatags }))} | 
					
						
							|  |  |  |           {#if config.IsKnown(_tags)} | 
					
						
							|  |  |  |             <TagRenderingEditable {tags} {config} {state} {selectedElement} {layer} | 
					
						
							|  |  |  |                                   {highlightedRendering}></TagRenderingEditable> | 
					
						
							|  |  |  |           {/if} | 
					
						
							| 
									
										
										
										
											2023-03-31 03:28:11 +02:00
										 |  |  |         {/if} | 
					
						
							| 
									
										
										
										
											2023-04-20 17:42:07 +02:00
										 |  |  |       {/each} | 
					
						
							|  |  |  |     </div> | 
					
						
							| 
									
										
										
										
											2023-03-29 17:21:20 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-04-20 17:42:07 +02:00
										 |  |  |   </div> | 
					
						
							|  |  |  | {/if} |