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": { "render": {
"special": { "special": {
"type": "show_icons", "class": "inline-flex float-right",
"labels": "diets_content", "labels": "diets_content",
"class": "inline-flex float-right" "type": "show_icons"
}, },
"before": { "before": {
"en": "Dietary options", "en": "Dietary options",

View file

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

View file

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

View file

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

View file

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

View file

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