From f9c8986101b08b45e3fc298e4bbca72d471e6b59 Mon Sep 17 00:00:00 2001 From: Pieter Vander Vennet Date: Tue, 19 Mar 2024 02:07:10 +0100 Subject: [PATCH] Increase QR-code size, make it toggleable --- src/UI/SpecialVisualizations.ts | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/src/UI/SpecialVisualizations.ts b/src/UI/SpecialVisualizations.ts index 38a08f116..c96f5c62d 100644 --- a/src/UI/SpecialVisualizations.ts +++ b/src/UI/SpecialVisualizations.ts @@ -1598,6 +1598,9 @@ export default class SpecialVisualizations { feature: Feature, layer: LayerConfig ): BaseUIElement { + const smallSize = 100 + const bigSize = 200 + const size = new UIEventSource(smallSize) return new VariableUiElement( tagSource .map((tags) => tags.id) @@ -1617,11 +1620,17 @@ export default class SpecialVisualizations { const url = `${window.location.protocol}//${window.location.host}${window.location.pathname}?${layout}lat=${lat}&lon=${lon}&z=15` + `#${id}` - return new Img(new Qr(url).toImageElement(75)).SetStyle( - "width: 75px" + return new Img(new Qr(url).toImageElement(size.data)).SetStyle( + `width: ${size.data}px` ) - }) - ) + }, [size]) + ).onClick(()=> { + if(size.data !== bigSize){ + size.setData(bigSize) + }else{ + size.setData(smallSize) + } + }) }, }, {