forked from MapComplete/MapComplete
Themes: add guideposts to climbing theme
This commit is contained in:
parent
da39dde7b6
commit
a96a214c03
7 changed files with 23 additions and 48 deletions
|
@ -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"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
|
Before Width: | Height: | Size: 78 KiB After Width: | Height: | Size: 78 KiB |
2
assets/layers/guidepost/guidepost_example.jpg.license
Normal file
2
assets/layers/guidepost/guidepost_example.jpg.license
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
SPDX-FileCopyrightText: Mschaeuble
|
||||||
|
SPDX-License-Identifier: CC0-1.0
|
|
@ -10,7 +10,7 @@
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"path": "signpost_example.jpg",
|
"path": "guidepost_example.jpg",
|
||||||
"license": "CC0-1.0",
|
"license": "CC0-1.0",
|
||||||
"authors": [
|
"authors": [
|
||||||
"Mschaeuble"
|
"Mschaeuble"
|
||||||
|
|
|
@ -1,2 +1,2 @@
|
||||||
SPDX-FileCopyrightText: Mschaeuble
|
SPDX-FileCopyrightText: Mschaeuble
|
||||||
SPDX-License-Identifier: CC0
|
SPDX-License-Identifier: CC0-1.0
|
|
@ -464,7 +464,8 @@
|
||||||
{
|
{
|
||||||
"builtin": [
|
"builtin": [
|
||||||
"toilet",
|
"toilet",
|
||||||
"drinking_water"
|
"drinking_water",
|
||||||
|
"guidepost"
|
||||||
],
|
],
|
||||||
"override": {
|
"override": {
|
||||||
"minzoom": 15
|
"minzoom": 15
|
||||||
|
|
|
@ -1,42 +1,14 @@
|
||||||
import { Utils } from "../../Utils"
|
import { Utils } from "../../Utils"
|
||||||
/** This code is autogenerated - do not edit. Edit ./assets/layers/usersettings/usersettings.json instead */
|
/** This code is autogenerated - do not edit. Edit ./assets/layers/usersettings/usersettings.json instead */
|
||||||
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(/</g,'<')?.replace(/>/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(/</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