forked from MapComplete/MapComplete
Chore: format layers
This commit is contained in:
parent
e9bcc70049
commit
ccdcb86044
6 changed files with 73 additions and 91 deletions
|
@ -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",
|
||||
|
|
|
@ -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": [
|
||||
|
|
|
@ -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",
|
||||
|
|
|
@ -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"
|
||||
}
|
||||
],
|
||||
|
|
|
@ -38,6 +38,9 @@
|
|||
"zh_Hant": "顯示由MapComplete進行的變動"
|
||||
},
|
||||
"icon": "./assets/svg/logo.svg",
|
||||
"startZoom": 1,
|
||||
"startLat": 0,
|
||||
"startLon": 0,
|
||||
"hideFromOverview": true,
|
||||
"layers": [
|
||||
{
|
||||
|
|
|
@ -4,39 +4,11 @@ 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(/</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"
|
||||
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'
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue