| 
									
										
										
										
											2021-09-28 17:30:48 +02:00
										 |  |  | import {Tiles} from "./Models/TileRange"; | 
					
						
							|  |  |  | import OsmFeatureSource from "./Logic/FeatureSource/TiledFeatureSource/OsmFeatureSource"; | 
					
						
							|  |  |  | import {Utils} from "./Utils"; | 
					
						
							| 
									
										
										
										
											2021-09-22 05:02:09 +02:00
										 |  |  | import {AllKnownLayouts} from "./Customizations/AllKnownLayouts"; | 
					
						
							| 
									
										
										
										
											2021-09-28 17:30:48 +02:00
										 |  |  | import LayerConfig from "./Models/ThemeConfig/LayerConfig"; | 
					
						
							| 
									
										
										
										
											2021-07-28 02:51:07 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-09-28 17:30:48 +02:00
										 |  |  | const allLayers: LayerConfig[] = [] | 
					
						
							|  |  |  | const seenIds = new Set<string>() | 
					
						
							|  |  |  | for (const layoutConfig of AllKnownLayouts.layoutsList) { | 
					
						
							|  |  |  |     if (layoutConfig.hideFromOverview) { | 
					
						
							|  |  |  |         continue | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  |     for (const layer of layoutConfig.layers) { | 
					
						
							|  |  |  |         if (seenIds.has(layer.id)) { | 
					
						
							|  |  |  |             continue | 
					
						
							|  |  |  |         } | 
					
						
							|  |  |  |         seenIds.add(layer.id) | 
					
						
							|  |  |  |         allLayers.push(layer) | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  | } | 
					
						
							| 
									
										
										
										
											2021-09-22 05:02:09 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-09-28 17:30:48 +02:00
										 |  |  | console.log("All layer ids", allLayers.map(l => l.id)) | 
					
						
							| 
									
										
										
										
											2021-09-22 05:02:09 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-09-28 17:30:48 +02:00
										 |  |  | const src = new OsmFeatureSource({ | 
					
						
							|  |  |  |     backend: "https://www.openstreetmap.org", | 
					
						
							|  |  |  |     handleTile: tile => console.log("Got tile", tile), | 
					
						
							|  |  |  |     allLayers: allLayers | 
					
						
							| 
									
										
										
										
											2021-09-27 15:38:12 +02:00
										 |  |  | }) | 
					
						
							| 
									
										
										
										
											2021-09-28 17:30:48 +02:00
										 |  |  | src.LoadTile(16, 33354, 21875).then(geojson => { | 
					
						
							|  |  |  |     console.log("Got geojson", geojson); | 
					
						
							|  |  |  |     Utils.offerContentsAsDownloadableFile(JSON.stringify(geojson), "test.geojson", { | 
					
						
							|  |  |  |         mimetype: "application/vnd.geo+json" | 
					
						
							|  |  |  |     }) | 
					
						
							|  |  |  | }) | 
					
						
							|  |  |  | //*/
 |