Small usability tweaks

This commit is contained in:
Pieter Vander Vennet 2023-12-25 19:59:58 +01:00
parent bfd818cb38
commit 32606856f9
7 changed files with 43 additions and 23 deletions

View file

@ -1569,14 +1569,23 @@ export default class SpecialVisualizations {
feature: Feature,
layer: LayerConfig
): BaseUIElement {
const url =
window.location.protocol +
"//" +
window.location.host +
window.location.pathname +
"#" +
feature.properties.id
return new Img(new Qr(url).toImageElement(75)).SetStyle("width: 75px")
return new VariableUiElement(
tagSource
.map((tags) => tags.id)
.map((id) => {
if (id.startsWith("node/-")) {
// Not yet uploaded
return undefined
}
const [lon, lat] = GeoOperations.centerpointCoordinates(feature)
const url =
`${window.location.protocol}//${window.location.host}${window.location.pathname}?lat=${lat}&lon=${lon}&z=15` +
`#${id}`
return new Img(new Qr(url).toImageElement(75)).SetStyle(
"width: 75px"
)
})
)
},
},
]