forked from MapComplete/MapComplete
		
	refactoring(maplibre): WIP
This commit is contained in:
		
							parent
							
								
									231d67361e
								
							
						
					
					
						commit
						4d48b1cf2b
					
				
					 89 changed files with 1166 additions and 3973 deletions
				
			
		|  | @ -9,30 +9,9 @@ import LevelSelector from "./LevelSelector" | |||
| import { GeolocationControl } from "./GeolocationControl" | ||||
| 
 | ||||
| export default class RightControls extends Combine { | ||||
|     constructor( | ||||
|         state: MapState & { featurePipeline: FeaturePipeline }, | ||||
|         geolocationHandler: GeoLocationHandler | ||||
|     ) { | ||||
|         const geolocationButton = Toggle.If(state.featureSwitchGeolocation, () => | ||||
|             new MapControlButton(new GeolocationControl(geolocationHandler, state), { | ||||
|                 dontStyle: true, | ||||
|             }).SetClass("p-1") | ||||
|         ) | ||||
| 
 | ||||
|         const plus = new MapControlButton(Svg.plus_svg()).onClick(() => { | ||||
|             state.locationControl.data.zoom++ | ||||
|             state.locationControl.ping() | ||||
|         }) | ||||
| 
 | ||||
|         const min = new MapControlButton(Svg.min_svg()).onClick(() => { | ||||
|             state.locationControl.data.zoom-- | ||||
|             state.locationControl.ping() | ||||
|         }) | ||||
| 
 | ||||
|     constructor(state: MapState & { featurePipeline: FeaturePipeline }) { | ||||
|         const levelSelector = new LevelSelector(state) | ||||
|         super( | ||||
|             [levelSelector, plus, min, geolocationButton].map((el) => el.SetClass("m-0.5 md:m-1")) | ||||
|         ) | ||||
|         super([levelSelector].map((el) => el.SetClass("m-0.5 md:m-1"))) | ||||
|         this.SetClass("flex flex-col items-center") | ||||
|     } | ||||
| } | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue