forked from MapComplete/MapComplete
		
	Fix direction input element
This commit is contained in:
		
							parent
							
								
									61b6721342
								
							
						
					
					
						commit
						4a00c0e357
					
				
					 3 changed files with 25 additions and 7 deletions
				
			
		|  | @ -53,9 +53,10 @@ export default class DirectionInput extends InputElement<string> { | |||
|                 `position: absolute;top: 0;left: 0;width: 100%;height: 100%;transform:rotate(${this.value.data ?? 0}deg);`) | ||||
|                 .SetClass("direction-svg relative") | ||||
|                  .SetStyle("z-index: 1000"), | ||||
|             map.SetClass("w-full h-full absolute top-0 left-O rounded-full overflow-hidden"), | ||||
|             map.SetClass("w-full h-full block absolute top-0 left-O overflow-hidden"), | ||||
|         ]) | ||||
|             .SetStyle("position:relative;display:block;width: min(100%, 25em); height: min(100% , 25em); background:white; border: 1px solid black; border-radius: 999em") | ||||
|             .SetStyle("width: min(100%, 25em); height: min(100% , 25em);") | ||||
|             .SetClass("relative block bg-white border border-black overflow-hidden rounded-full") | ||||
|             .ConstructElement() | ||||
| 
 | ||||
| 
 | ||||
|  | @ -67,6 +68,7 @@ export default class DirectionInput extends InputElement<string> { | |||
| 
 | ||||
|         this.RegisterTriggers(element) | ||||
|         element.style.overflow = "hidden" | ||||
|         element.style.display = "block" | ||||
| 
 | ||||
|         return element; | ||||
|     } | ||||
|  |  | |||
|  | @ -41,10 +41,6 @@ export default class LengthInput extends InputElement<string> { | |||
|     } | ||||
| 
 | ||||
|     protected InnerConstructElement(): HTMLElement { | ||||
|         const modeElement = new RadioButton([ | ||||
|             new FixedInputElement("Measure", "measure"), | ||||
|             new FixedInputElement("Move", "move") | ||||
|         ]) | ||||
|         // @ts-ignore
 | ||||
|         let map = undefined | ||||
|         if (!Utils.runningFromConsole) { | ||||
|  |  | |||
							
								
								
									
										22
									
								
								test.ts
									
										
									
									
									
								
							
							
						
						
									
										22
									
								
								test.ts
									
										
									
									
									
								
							|  | @ -8,8 +8,28 @@ import {LocalStorageSource} from "./Logic/Web/LocalStorageSource"; | |||
| import LZString from "lz-string"; | ||||
| import {LayoutConfigJson} from "./Models/ThemeConfig/Json/LayoutConfigJson"; | ||||
| import Combine from "./UI/Base/Combine"; | ||||
| import DirectionInput from "./UI/Input/DirectionInput"; | ||||
| import Loc from "./Models/Loc"; | ||||
| import AvailableBaseLayers from "./Logic/Actors/AvailableBaseLayers"; | ||||
| import Minimap from "./UI/Base/Minimap"; | ||||
| import ValidatedTextField from "./UI/Input/ValidatedTextField"; | ||||
| 
 | ||||
| 
 | ||||
| const location = new UIEventSource<Loc>({ | ||||
|     zoom: 18, | ||||
|     lat: 51.2, | ||||
|     lon: 4.3 | ||||
| }) | ||||
| DirectionInput.constructMinimap = options =>  new Minimap(options) | ||||
| 
 | ||||
| new DirectionInput( | ||||
|     AvailableBaseLayers.SelectBestLayerAccordingTo(location, new UIEventSource<string | string[]>("map")), | ||||
|     location | ||||
| ).SetStyle("height: 250px; width: 250px") | ||||
|     .SetClass("block") | ||||
|     .AttachTo("maindiv") | ||||
| 
 | ||||
| /* | ||||
| new VariableUiElement(Hash.hash.map( | ||||
|     hash => { | ||||
|         let json: {}; | ||||
|  | @ -28,4 +48,4 @@ new VariableUiElement(Hash.hash.map( | |||
|         ]).SetClass("flex flex-col m-1") | ||||
|     } | ||||
| )) | ||||
|     .AttachTo("maindiv") | ||||
|     .AttachTo("maindiv")*/ | ||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue