| 
									
										
										
										
											2021-09-21 01:47:58 +02:00
										 |  |  | /** | 
					
						
							|  |  |  |  * SHows geojson on the given leaflet map, but attempts to figure out the correct layer first | 
					
						
							|  |  |  |  */ | 
					
						
							| 
									
										
										
										
											2022-07-08 03:14:55 +02:00
										 |  |  | import {Store} from "../../Logic/UIEventSource"; | 
					
						
							| 
									
										
										
										
											2021-09-21 02:10:42 +02:00
										 |  |  | import ShowDataLayer from "./ShowDataLayer"; | 
					
						
							|  |  |  | import PerLayerFeatureSourceSplitter from "../../Logic/FeatureSource/PerLayerFeatureSourceSplitter"; | 
					
						
							|  |  |  | import FilteredLayer from "../../Models/FilteredLayer"; | 
					
						
							|  |  |  | import {ShowDataLayerOptions} from "./ShowDataLayerOptions"; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-09-21 01:47:58 +02:00
										 |  |  | export default class ShowDataMultiLayer { | 
					
						
							| 
									
										
										
										
											2022-07-08 03:14:55 +02:00
										 |  |  |     constructor(options: ShowDataLayerOptions & { layers: Store<FilteredLayer[]> }) { | 
					
						
							| 
									
										
										
										
											2021-09-21 01:47:58 +02:00
										 |  |  | 
 | 
					
						
							|  |  |  |         new PerLayerFeatureSourceSplitter(options.layers, (perLayer => { | 
					
						
							|  |  |  |                 const newOptions = { | 
					
						
							| 
									
										
										
										
											2021-12-09 01:22:57 +01:00
										 |  |  |                     ...options, | 
					
						
							| 
									
										
										
										
											2021-09-21 01:47:58 +02:00
										 |  |  |                     layerToShow: perLayer.layer.layerDef, | 
					
						
							| 
									
										
										
										
											2021-12-09 01:22:57 +01:00
										 |  |  |                     features: perLayer | 
					
						
							| 
									
										
										
										
											2021-09-21 01:47:58 +02:00
										 |  |  |                 } | 
					
						
							|  |  |  |                 new ShowDataLayer(newOptions) | 
					
						
							|  |  |  |             }), | 
					
						
							|  |  |  |             options.features) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  | } |