forked from MapComplete/MapComplete
Small usability tweaks
This commit is contained in:
parent
bfd818cb38
commit
32606856f9
7 changed files with 43 additions and 23 deletions
|
@ -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"
|
||||
)
|
||||
})
|
||||
)
|
||||
},
|
||||
},
|
||||
]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue