| 
									
										
										
										
											2022-09-08 21:40:48 +02:00
										 |  |  | import BaseUIElement from "../BaseUIElement" | 
					
						
							|  |  |  | import Loc from "../../Models/Loc" | 
					
						
							|  |  |  | import BaseLayer from "../../Models/BaseLayer" | 
					
						
							|  |  |  | import { UIEventSource } from "../../Logic/UIEventSource" | 
					
						
							|  |  |  | import { BBox } from "../../Logic/BBox" | 
					
						
							| 
									
										
										
										
											2022-10-27 01:50:41 +02:00
										 |  |  | import { deprecate } from "util" | 
					
						
							| 
									
										
										
										
											2021-09-03 13:48:04 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-09-21 02:10:42 +02:00
										 |  |  | export interface MinimapOptions { | 
					
						
							| 
									
										
										
										
											2022-09-08 21:40:48 +02:00
										 |  |  |     background?: UIEventSource<BaseLayer> | 
					
						
							|  |  |  |     location?: UIEventSource<Loc> | 
					
						
							|  |  |  |     bounds?: UIEventSource<BBox> | 
					
						
							|  |  |  |     allowMoving?: boolean | 
					
						
							|  |  |  |     leafletOptions?: any | 
					
						
							|  |  |  |     attribution?: BaseUIElement | boolean | 
					
						
							|  |  |  |     onFullyLoaded?: (leaflet: L.Map) => void | 
					
						
							|  |  |  |     leafletMap?: UIEventSource<any> | 
					
						
							|  |  |  |     lastClickLocation?: UIEventSource<{ lat: number; lon: number }> | 
					
						
							| 
									
										
										
										
											2021-11-21 02:44:35 +01:00
										 |  |  |     addLayerControl?: boolean | false | 
					
						
							| 
									
										
										
										
											2021-09-21 02:10:42 +02:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-09-22 05:02:09 +02:00
										 |  |  | export interface MinimapObj { | 
					
						
							| 
									
										
										
										
											2022-09-08 21:40:48 +02:00
										 |  |  |     readonly leafletMap: UIEventSource<any> | 
					
						
							|  |  |  |     readonly location: UIEventSource<Loc> | 
					
						
							|  |  |  |     readonly bounds: UIEventSource<BBox> | 
					
						
							| 
									
										
										
										
											2021-11-07 16:34:51 +01:00
										 |  |  | 
 | 
					
						
							|  |  |  |     installBounds(factor: number | BBox, showRange?: boolean): void | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-09-12 20:14:03 +02:00
										 |  |  |     TakeScreenshot(format): Promise<string> | 
					
						
							|  |  |  |     TakeScreenshot(format: "image"): Promise<string> | 
					
						
							| 
									
										
										
										
											2022-10-27 01:50:41 +02:00
										 |  |  |     TakeScreenshot(format: "blob"): Promise<Blob> | 
					
						
							| 
									
										
										
										
											2022-09-12 20:14:03 +02:00
										 |  |  |     TakeScreenshot(format?: "image" | "blob"): Promise<string | Blob> | 
					
						
							| 
									
										
										
										
											2021-09-22 05:02:09 +02:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-09-21 02:10:42 +02:00
										 |  |  | export default class Minimap { | 
					
						
							|  |  |  |     /** | 
					
						
							|  |  |  |      * A stub implementation. The actual implementation is injected later on, but only in the browser. | 
					
						
							|  |  |  |      * importing leaflet crashes node-ts, which is pretty annoying considering the fact that a lot of scripts use it | 
					
						
							|  |  |  |      */ | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-09-08 21:40:48 +02:00
										 |  |  |     private constructor() {} | 
					
						
							| 
									
										
										
										
											2022-01-26 21:40:38 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-09-21 02:10:42 +02:00
										 |  |  |     /** | 
					
						
							|  |  |  |      * Construct a minimap | 
					
						
							|  |  |  |      */ | 
					
						
							| 
									
										
										
										
											2022-09-08 21:40:48 +02:00
										 |  |  |     public static createMiniMap: (options?: MinimapOptions) => BaseUIElement & MinimapObj = (_) => { | 
					
						
							| 
									
										
										
										
											2021-09-27 15:38:12 +02:00
										 |  |  |         throw "CreateMinimap hasn't been initialized yet. Please call MinimapImplementation.initialize()" | 
					
						
							|  |  |  |     } | 
					
						
							| 
									
										
										
										
											2022-09-08 21:40:48 +02:00
										 |  |  | } |