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

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

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

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