Chore: format layers

This commit is contained in:
Pieter Vander Vennet 2025-08-18 12:56:07 +02:00
parent e9bcc70049
commit ccdcb86044
6 changed files with 73 additions and 91 deletions

View file

@ -13,9 +13,9 @@
],
"render": {
"special": {
"type": "show_icons",
"class": "inline-flex float-right",
"labels": "diets_content",
"class": "inline-flex float-right"
"type": "show_icons"
},
"before": {
"en": "Dietary options",

View file

@ -132,7 +132,9 @@
"tags": [
"historic=locomotive"
],
"snapToLayer": ["railway"]
"snapToLayer": [
"railway"
]
},
{
"title": {
@ -146,8 +148,9 @@
"tags": [
"historic=railway_car"
],
"snapToLayer": ["railway"]
"snapToLayer": [
"railway"
]
},
{
"title": {
@ -161,8 +164,9 @@
"tags": [
"historic=minecart"
],
"snapToLayer": ["railway"]
"snapToLayer": [
"railway"
]
}
],
"tagRenderings": [

View file

@ -13,14 +13,11 @@
"railway=tram",
"railway=subway",
"railway=light_rail",
"railway=disused",
"disused:railway=rail",
"disused:railway=tram",
"disused:railway=subway",
"disused:railway=light_rail",
"abandoned:railway=rail",
"abandoned:railway=tram",
"abandoned:railway=subway",

View file

@ -54,12 +54,14 @@
},
"title": {
"render": "OSM-building",
"mappings": [{
"mappings": [
{
"if": "building:part~*",
"then": {
"en": "Building part"
}
}]
}
]
},
"tagRenderings": [
{
@ -261,7 +263,8 @@
],
"pointRendering": [
{
"marker": [{
"marker": [
{
"icon": "circle",
"color": {
"render": "#00c",
@ -297,8 +300,11 @@
}
]
}
}],
"location": ["centroid"],
}
],
"location": [
"centroid"
],
"iconSize": "10,10"
}
],

View file

@ -38,6 +38,9 @@
"zh_Hant": "顯示由MapComplete進行的變動"
},
"icon": "./assets/svg/logo.svg",
"startZoom": 1,
"startLat": 0,
"startLon": 0,
"hideFromOverview": true,
"layers": [
{

View file

@ -3,40 +3,12 @@ import { Utils } from "../../Utils"
export class ThemeMetaTagging {
public static readonly themeName = "usersettings"
public metaTaggging_for_usersettings(feat: { properties: Record<string, string> }) {
Utils.AddLazyProperty(feat.properties, "_mastodon_candidate_md", () =>
feat.properties._description
.match(/\[[^\]]*\]\((.*(mastodon|en.osm.town).*)\).*/)
?.at(1)
)
Utils.AddLazyProperty(
feat.properties,
"_d",
() => feat.properties._description?.replace(/&lt;/g, "<")?.replace(/&gt;/g, ">") ?? ""
)
Utils.AddLazyProperty(feat.properties, "_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)
)
Utils.AddLazyProperty(feat.properties, "_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)
)
Utils.AddLazyProperty(
feat.properties,
"_mastodon_candidate",
() => feat.properties._mastodon_candidate_md ?? feat.properties._mastodon_candidate_a
)
feat.properties["__current_backgroun"] = "initial_value"
public metaTaggging_for_usersettings(feat: {properties: Record<string, string>}) {
Utils.AddLazyProperty(feat.properties, '_mastodon_candidate_md', () => feat.properties._description.match(/\[[^\]]*\]\((.*(mastodon|en.osm.town).*)\).*/)?.at(1) )
Utils.AddLazyProperty(feat.properties, '_d', () => feat.properties._description?.replace(/&lt;/g,'<')?.replace(/&gt;/g,'>') ?? '' )
Utils.AddLazyProperty(feat.properties, '_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) )
Utils.AddLazyProperty(feat.properties, '_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) )
Utils.AddLazyProperty(feat.properties, '_mastodon_candidate', () => feat.properties._mastodon_candidate_md ?? feat.properties._mastodon_candidate_a )
feat.properties['__current_backgroun'] = 'initial_value'
}
}