Feature: be able to set a default background layer, fix background layer query parameter

This commit is contained in:
Pieter Vander Vennet 2023-09-24 16:34:36 +02:00
parent 93a30fdba5
commit 456da1b6c3
7 changed files with 401 additions and 280 deletions

View file

@ -23,7 +23,8 @@
"_d=feat.properties._description?.replace(/&lt;/g,'<')?.replace(/&gt;/g,'>') ?? ''",
"_mastodon_candidate_a=(feat => {const e = document.createElement('div');e.innerHTML = feat.properties._d;return Array.from(e.getElementsByTagName(\"a\")).filter(a => a.href.match(/mastodon|en.osm.town/) !== null)[0]?.href }) (feat) ",
"_mastodon_link=(feat => {const e = document.createElement('div');e.innerHTML = feat.properties._d;return Array.from(e.getElementsByTagName(\"a\")).filter(a => a.getAttribute(\"rel\")?.indexOf('me') >= 0)[0]?.href})(feat) ",
"_mastodon_candidate=feat.properties._mastodon_candidate_md ?? feat.properties._mastodon_candidate_a"
"_mastodon_candidate=feat.properties._mastodon_candidate_md ?? feat.properties._mastodon_candidate_a",
"__current_background='some value to let the validation run through'"
],
"tagRenderings": [
{
@ -103,6 +104,54 @@
"*": "{logout()}"
}
},
{
"id": "background-layer",
"question": {
"en": "What background layer should be shown by default?"
},
"mappings": [
{
"if": "mapcomplete-preferred-background-layer=",
"then": {
"en": "Use the default background layer"
}
},
{
"if": "mapcomplete-preferred-background-layer=osm",
"then": {
"en": "Use OpenStreetMap-carto as default layer"
}
},
{
"if": "mapcomplete-preferred-background-layer=photo",
"then": {
"en": "Use aerial imagery as default background"
}
},
{
"if": "mapcomplete-preferred-background-layer=map",
"then": {
"en": "Use a non-openstreetmap based map as default background"
}
},
{
"if": "mapcomplete-preferred-background-layer:={__current_background}",
"then": {
"en": "Use the current background layer (<span class='code'>{__current_background}</span>) as default background"
},
"hideInAnswer": {
"or": ["__current_background=","__current_background=osm"]
}
},
{
"if": "mapcomplete-preferred-background-layer~*",
"then": {
"en": "Use background layer <span class='code'>{mapcomplete-preferred-background-layer}</span> as default background"
},
"hideInAnswer": true
}
]
},
{
"id": "picture-license",
"description": "This question is not meant to be placed on an OpenStreetMap-element; however it is used in the user information panel to ask which license the user wants",