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

@ -45,7 +45,7 @@
}, },
{ {
"or": [ "or": [
"building~*", "building~*",
"building:part~*" "building:part~*"
] ]
} }
@ -54,12 +54,14 @@
}, },
"title": { "title": {
"render": "OSM-building", "render": "OSM-building",
"mappings": [{ "mappings": [
"if": "building:part~*", {
"then": { "if": "building:part~*",
"en": "Building part" "then": {
"en": "Building part"
}
} }
}] ]
}, },
"tagRenderings": [ "tagRenderings": [
{ {
@ -166,7 +168,7 @@
] ]
}, },
{ {
"condition": "building:part=", "condition": "building:part=",
"id": "grb-street", "id": "grb-street",
"render": { "render": {
"nl": "De straat is <b>{addr:street}</b>" "nl": "De straat is <b>{addr:street}</b>"
@ -261,44 +263,48 @@
], ],
"pointRendering": [ "pointRendering": [
{ {
"marker": [{ "marker": [
"icon": "circle", {
"color": { "icon": "circle",
"render": "#00c", "color": {
"mappings": [ "render": "#00c",
{ "mappings": [
"if": "fixme~*", {
"then": "#ff00ff" "if": "fixme~*",
}, "then": "#ff00ff"
{
"if": "building=house",
"then": "#a00"
},
{
"if": "building=shed",
"then": "#563e02"
},
{
"if": {
"or": [
"building=garage",
"building=garages"
]
}, },
"then": "#f9bfbb" {
}, "if": "building=house",
{ "then": "#a00"
"if": "building=yes", },
"then": "#0774f2" {
}, "if": "building=shed",
{ "then": "#563e02"
"if": "building:part~*", },
"then": "#f8fc25" {
} "if": {
] "or": [
"building=garage",
"building=garages"
]
},
"then": "#f9bfbb"
},
{
"if": "building=yes",
"then": "#0774f2"
},
{
"if": "building:part~*",
"then": "#f8fc25"
}
]
}
} }
}], ],
"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

@ -1,42 +1,14 @@
import { Utils } from "../../Utils" import { Utils } from "../../Utils"
/** This code is autogenerated - do not edit. Edit ./assets/layers/usersettings/usersettings.json instead */ /** This code is autogenerated - do not edit. Edit ./assets/layers/usersettings/usersettings.json instead */
export class ThemeMetaTagging { 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"
}
}