From 4a00c0e357b9b2bd3454decac1df73a862b90cba Mon Sep 17 00:00:00 2001 From: pietervdvn Date: Thu, 26 Aug 2021 16:24:18 +0200 Subject: [PATCH] Fix direction input element --- UI/Input/DirectionInput.ts | 6 ++++-- UI/Input/LengthInput.ts | 4 ---- test.ts | 22 +++++++++++++++++++++- 3 files changed, 25 insertions(+), 7 deletions(-) diff --git a/UI/Input/DirectionInput.ts b/UI/Input/DirectionInput.ts index 93d932c66..07b506490 100644 --- a/UI/Input/DirectionInput.ts +++ b/UI/Input/DirectionInput.ts @@ -53,9 +53,10 @@ export default class DirectionInput extends InputElement { `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 { this.RegisterTriggers(element) element.style.overflow = "hidden" + element.style.display = "block" return element; } diff --git a/UI/Input/LengthInput.ts b/UI/Input/LengthInput.ts index 7b690f691..2ea7e7fc6 100644 --- a/UI/Input/LengthInput.ts +++ b/UI/Input/LengthInput.ts @@ -41,10 +41,6 @@ export default class LengthInput extends InputElement { } protected InnerConstructElement(): HTMLElement { - const modeElement = new RadioButton([ - new FixedInputElement("Measure", "measure"), - new FixedInputElement("Move", "move") - ]) // @ts-ignore let map = undefined if (!Utils.runningFromConsole) { diff --git a/test.ts b/test.ts index 81a1e1801..cd8c87bfb 100644 --- a/test.ts +++ b/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({ + zoom: 18, + lat: 51.2, + lon: 4.3 +}) +DirectionInput.constructMinimap = options => new Minimap(options) + +new DirectionInput( + AvailableBaseLayers.SelectBestLayerAccordingTo(location, new UIEventSource("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") \ No newline at end of file + .AttachTo("maindiv")*/ \ No newline at end of file