From ccdcb8604475abffd6bed6b8704fae48c98d82c0 Mon Sep 17 00:00:00 2001 From: Pieter Vander Vennet Date: Mon, 18 Aug 2025 12:56:07 +0200 Subject: [PATCH] Chore: format layers --- assets/layers/diets/diets.json | 4 +- .../historic_rolling_stock.json | 14 ++- assets/layers/railway/railway.json | 3 - assets/themes/grb/grb.json | 92 ++++++++++--------- .../mapcomplete-changes.json | 3 + src/Logic/State/UserSettingsMetaTagging.ts | 48 ++-------- 6 files changed, 73 insertions(+), 91 deletions(-) diff --git a/assets/layers/diets/diets.json b/assets/layers/diets/diets.json index cac1388a3..7b82778bf 100644 --- a/assets/layers/diets/diets.json +++ b/assets/layers/diets/diets.json @@ -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", diff --git a/assets/layers/historic_rolling_stock/historic_rolling_stock.json b/assets/layers/historic_rolling_stock/historic_rolling_stock.json index 21eb1633f..4d453c6fc 100644 --- a/assets/layers/historic_rolling_stock/historic_rolling_stock.json +++ b/assets/layers/historic_rolling_stock/historic_rolling_stock.json @@ -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": [ diff --git a/assets/layers/railway/railway.json b/assets/layers/railway/railway.json index 50ddecf0b..fce3773bf 100644 --- a/assets/layers/railway/railway.json +++ b/assets/layers/railway/railway.json @@ -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", diff --git a/assets/themes/grb/grb.json b/assets/themes/grb/grb.json index 256070bca..14f70e18e 100644 --- a/assets/themes/grb/grb.json +++ b/assets/themes/grb/grb.json @@ -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 {addr:street}" @@ -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" } ], diff --git a/assets/themes/mapcomplete-changes/mapcomplete-changes.json b/assets/themes/mapcomplete-changes/mapcomplete-changes.json index 5b19fa6de..80382fd51 100644 --- a/assets/themes/mapcomplete-changes/mapcomplete-changes.json +++ b/assets/themes/mapcomplete-changes/mapcomplete-changes.json @@ -38,6 +38,9 @@ "zh_Hant": "顯示由MapComplete進行的變動" }, "icon": "./assets/svg/logo.svg", + "startZoom": 1, + "startLat": 0, + "startLon": 0, "hideFromOverview": true, "layers": [ { diff --git a/src/Logic/State/UserSettingsMetaTagging.ts b/src/Logic/State/UserSettingsMetaTagging.ts index 6e568c5c3..33a5ae85b 100644 --- a/src/Logic/State/UserSettingsMetaTagging.ts +++ b/src/Logic/State/UserSettingsMetaTagging.ts @@ -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 }) { - 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(/</g, "<")?.replace(/>/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}) { + 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(/</g,'<')?.replace(/>/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' + } +} \ No newline at end of file