Themes: add guideposts to climbing theme

This commit is contained in:
Pieter Vander Vennet 2023-10-07 03:37:19 +02:00
parent da39dde7b6
commit a96a214c03
7 changed files with 23 additions and 48 deletions

View file

@ -32,18 +32,18 @@
"enableImproveAccuracy": "true",
"enableRelocation": "false"
},
"title": {},
"pointRendering": [
"title": {
"render": {
"en": "Guidepost"
}
},
"mapRendering": [
{
"location": [
"centroid",
"point"
],
"marker": [
{
"icon": "./assets/layers/guidepost/guidepost.svg"
}
],
"icon": "./assets/layers/guidepost/guidepost.svg",
"anchor": "bottom"
}
],

View file

Before

Width:  |  Height:  |  Size: 78 KiB

After

Width:  |  Height:  |  Size: 78 KiB

View file

@ -0,0 +1,2 @@
SPDX-FileCopyrightText: Mschaeuble
SPDX-License-Identifier: CC0-1.0

View file

@ -10,7 +10,7 @@
]
},
{
"path": "signpost_example.jpg",
"path": "guidepost_example.jpg",
"license": "CC0-1.0",
"authors": [
"Mschaeuble"

View file

@ -1,2 +1,2 @@
SPDX-FileCopyrightText: Mschaeuble
SPDX-License-Identifier: CC0
SPDX-License-Identifier: CC0-1.0

View file

@ -464,7 +464,8 @@
{
"builtin": [
"toilet",
"drinking_water"
"drinking_water",
"guidepost"
],
"override": {
"minzoom": 15

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'
}
}