forked from MapComplete/MapComplete
Increase QR-code size, make it toggleable
This commit is contained in:
parent
03e82ef3cb
commit
4a8f796f54
1 changed files with 13 additions and 4 deletions
|
@ -1598,6 +1598,9 @@ export default class SpecialVisualizations {
|
||||||
feature: Feature,
|
feature: Feature,
|
||||||
layer: LayerConfig
|
layer: LayerConfig
|
||||||
): BaseUIElement {
|
): BaseUIElement {
|
||||||
|
const smallSize = 100
|
||||||
|
const bigSize = 200
|
||||||
|
const size = new UIEventSource(smallSize)
|
||||||
return new VariableUiElement(
|
return new VariableUiElement(
|
||||||
tagSource
|
tagSource
|
||||||
.map((tags) => tags.id)
|
.map((tags) => tags.id)
|
||||||
|
@ -1617,11 +1620,17 @@ export default class SpecialVisualizations {
|
||||||
const url =
|
const url =
|
||||||
`${window.location.protocol}//${window.location.host}${window.location.pathname}?${layout}lat=${lat}&lon=${lon}&z=15` +
|
`${window.location.protocol}//${window.location.host}${window.location.pathname}?${layout}lat=${lat}&lon=${lon}&z=15` +
|
||||||
`#${id}`
|
`#${id}`
|
||||||
return new Img(new Qr(url).toImageElement(75)).SetStyle(
|
return new Img(new Qr(url).toImageElement(size.data)).SetStyle(
|
||||||
"width: 75px"
|
`width: ${size.data}px`
|
||||||
)
|
)
|
||||||
|
}, [size])
|
||||||
|
).onClick(()=> {
|
||||||
|
if(size.data !== bigSize){
|
||||||
|
size.setData(bigSize)
|
||||||
|
}else{
|
||||||
|
size.setData(smallSize)
|
||||||
|
}
|
||||||
})
|
})
|
||||||
)
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue