| 
									
										
										
										
											2022-09-08 21:40:48 +02:00
										 |  |  | import Combine from "../Base/Combine" | 
					
						
							|  |  |  | import Toggle from "../Input/Toggle" | 
					
						
							|  |  |  | import MapControlButton from "../MapControlButton" | 
					
						
							|  |  |  | import GeoLocationHandler from "../../Logic/Actors/GeoLocationHandler" | 
					
						
							|  |  |  | import Svg from "../../Svg" | 
					
						
							|  |  |  | import MapState from "../../Logic/State/MapState" | 
					
						
							|  |  |  | import FeaturePipeline from "../../Logic/FeatureSource/FeaturePipeline" | 
					
						
							|  |  |  | import LevelSelector from "./LevelSelector" | 
					
						
							| 
									
										
										
										
											2022-12-22 04:13:52 +01:00
										 |  |  | import { GeolocationControl } from "./GeolocationControl" | 
					
						
							| 
									
										
										
										
											2021-07-28 16:48:59 +02:00
										 |  |  | 
 | 
					
						
							|  |  |  | export default class RightControls extends Combine { | 
					
						
							| 
									
										
										
										
											2022-12-22 04:13:52 +01:00
										 |  |  |     constructor( | 
					
						
							|  |  |  |         state: MapState & { featurePipeline: FeaturePipeline }, | 
					
						
							|  |  |  |         geolocationHandler: GeoLocationHandler | 
					
						
							|  |  |  |     ) { | 
					
						
							| 
									
										
										
										
											2023-02-07 02:11:17 +01:00
										 |  |  |         const geolocationButton = Toggle.If(state.featureSwitchGeolocation, () => | 
					
						
							| 
									
										
										
										
											2022-12-24 02:12:22 +01:00
										 |  |  |             new MapControlButton(new GeolocationControl(geolocationHandler, state), { | 
					
						
							| 
									
										
										
										
											2022-09-08 21:40:48 +02:00
										 |  |  |                 dontStyle: true, | 
					
						
							| 
									
										
										
										
											2023-02-07 02:11:17 +01:00
										 |  |  |             }).SetClass("p-1") | 
					
						
							| 
									
										
										
										
											2022-09-08 21:40:48 +02:00
										 |  |  |         ) | 
					
						
							| 
									
										
										
										
											2021-07-28 16:48:59 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-09-08 21:40:48 +02:00
										 |  |  |         const plus = new MapControlButton(Svg.plus_svg()).onClick(() => { | 
					
						
							|  |  |  |             state.locationControl.data.zoom++ | 
					
						
							|  |  |  |             state.locationControl.ping() | 
					
						
							|  |  |  |         }) | 
					
						
							| 
									
										
										
										
											2021-07-28 16:48:59 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-09-08 21:40:48 +02:00
										 |  |  |         const min = new MapControlButton(Svg.min_svg()).onClick(() => { | 
					
						
							|  |  |  |             state.locationControl.data.zoom-- | 
					
						
							|  |  |  |             state.locationControl.ping() | 
					
						
							|  |  |  |         }) | 
					
						
							| 
									
										
										
										
											2021-07-28 16:48:59 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-09-08 21:40:48 +02:00
										 |  |  |         const levelSelector = new LevelSelector(state) | 
					
						
							|  |  |  |         super( | 
					
						
							|  |  |  |             [levelSelector, plus, min, geolocationButton].map((el) => el.SetClass("m-0.5 md:m-1")) | 
					
						
							|  |  |  |         ) | 
					
						
							| 
									
										
										
										
											2021-08-19 23:41:48 +02:00
										 |  |  |         this.SetClass("flex flex-col items-center") | 
					
						
							| 
									
										
										
										
											2021-07-28 16:48:59 +02:00
										 |  |  |     } | 
					
						
							| 
									
										
										
										
											2022-09-08 21:40:48 +02:00
										 |  |  | } |