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", "enableImproveAccuracy": "true",
"enableRelocation": "false" "enableRelocation": "false"
}, },
"title": {}, "title": {
"pointRendering": [ "render": {
"en": "Guidepost"
}
},
"mapRendering": [
{ {
"location": [ "location": [
"centroid", "centroid",
"point" "point"
], ],
"marker": [ "icon": "./assets/layers/guidepost/guidepost.svg",
{
"icon": "./assets/layers/guidepost/guidepost.svg"
}
],
"anchor": "bottom" "anchor": "bottom"
} }
], ],

View file

Before

Width:  |  Height:  |  Size: 78 KiB

After

Width:  |  Height:  |  Size: 78 KiB

Before After
Before After

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", "license": "CC0-1.0",
"authors": [ "authors": [
"Mschaeuble" "Mschaeuble"

View file

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

View file

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

View file

@ -3,40 +3,12 @@ import { Utils } from "../../Utils"
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"
} }
} }