Fix merge
This commit is contained in:
parent
0c9a4576c0
commit
d6cd0516bb
7 changed files with 30 additions and 52 deletions
|
@ -1,4 +1,5 @@
|
||||||
{
|
{
|
||||||
|
"id": "last_click",
|
||||||
"description": "This layer defines how to render the 'last click'-location. By default, it will show a marker with the possibility to add a new point (if there are some presets) and/or to add a new note (if the 'note' layer attribute is set). If none are possible, this layer won't show up",
|
"description": "This layer defines how to render the 'last click'-location. By default, it will show a marker with the possibility to add a new point (if there are some presets) and/or to add a new note (if the 'note' layer attribute is set). If none are possible, this layer won't show up",
|
||||||
"source": "special",
|
"source": "special",
|
||||||
"isShown": {
|
"isShown": {
|
||||||
|
|
|
@ -648,5 +648,6 @@
|
||||||
"render": "{all_tags()}"
|
"render": "{all_tags()}"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"mapRendering": null
|
"lineRendering": null,
|
||||||
|
"pointRendering": null
|
||||||
}
|
}
|
||||||
|
|
|
@ -391,9 +391,8 @@
|
||||||
"pointRendering": [
|
"pointRendering": [
|
||||||
{
|
{
|
||||||
"icon": "./assets/themes/waste_basket/waste_basket.svg",
|
"icon": "./assets/themes/waste_basket/waste_basket.svg",
|
||||||
"iconSize": {
|
"iconSize": "40,40",
|
||||||
"render": "40,40,center"
|
"anchor": "center",
|
||||||
},
|
|
||||||
"location": [
|
"location": [
|
||||||
"point"
|
"point"
|
||||||
]
|
]
|
||||||
|
|
|
@ -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"
|
|
||||||
}
|
|
||||||
}
|
}
|
|
@ -368,8 +368,7 @@ class ExpandTagRendering extends Conversion<
|
||||||
name +
|
name +
|
||||||
": layer " +
|
": layer " +
|
||||||
layerName +
|
layerName +
|
||||||
" not found. Maybe you meant on of " +
|
" not found for now, but ignoring as this is a bootstrapping run. "
|
||||||
candidates.slice(0, 3).join(", ")
|
|
||||||
)
|
)
|
||||||
} else {
|
} else {
|
||||||
errors.push(
|
errors.push(
|
||||||
|
@ -378,7 +377,7 @@ class ExpandTagRendering extends Conversion<
|
||||||
name +
|
name +
|
||||||
": layer " +
|
": layer " +
|
||||||
layerName +
|
layerName +
|
||||||
" not found. Maybe you meant on of " +
|
" not found. Maybe you meant one of " +
|
||||||
candidates.slice(0, 3).join(", ")
|
candidates.slice(0, 3).join(", ")
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
|
@ -102,14 +102,15 @@ export default class PointRenderingConfig extends WithContextLoader {
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
this.iconSize = this.tr("iconSize", "40,40")
|
this.iconSize = this.tr("iconSize", "40,40", context + ".iconsize")
|
||||||
this.anchor = this.tr("anchor", "center")
|
this.anchor = this.tr("anchor", "center", context + ".anchor")
|
||||||
this.label = this.tr("label", undefined)
|
this.label = this.tr("label", undefined, context + ".label")
|
||||||
this.rotation = this.tr("rotation", "0")
|
this.rotation = this.tr("rotation", "0", context + ".rotation")
|
||||||
this.pitchAlignment = this.tr("pitchAlignment", "canvas")
|
this.pitchAlignment = this.tr("pitchAlignment", "canvas", context + ".pitchAlignment")
|
||||||
this.rotationAlignment = this.tr(
|
this.rotationAlignment = this.tr(
|
||||||
"rotationAlignment",
|
"rotationAlignment",
|
||||||
json.pitchAlignment === "map" ? "map" : "canvas"
|
json.pitchAlignment === "map" ? "map" : "canvas",
|
||||||
|
context + ".rotationAlignment"
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -18,6 +18,7 @@ import { FixedUiElement } from "../../UI/Base/FixedUiElement"
|
||||||
import { Paragraph } from "../../UI/Base/Paragraph"
|
import { Paragraph } from "../../UI/Base/Paragraph"
|
||||||
import Svg from "../../Svg"
|
import Svg from "../../Svg"
|
||||||
import Validators, { ValidatorType } from "../../UI/InputElement/Validators"
|
import Validators, { ValidatorType } from "../../UI/InputElement/Validators"
|
||||||
|
import { TagRenderingConfigJson } from "./Json/TagRenderingConfigJson"
|
||||||
|
|
||||||
export interface Icon {}
|
export interface Icon {}
|
||||||
|
|
||||||
|
@ -76,7 +77,11 @@ export default class TagRenderingConfig {
|
||||||
public readonly labels: string[]
|
public readonly labels: string[]
|
||||||
public readonly classes: string[]
|
public readonly classes: string[]
|
||||||
|
|
||||||
constructor(json: string | QuestionableTagRenderingConfigJson, context?: string) {
|
constructor(
|
||||||
|
config: string | TagRenderingConfigJson | QuestionableTagRenderingConfigJson,
|
||||||
|
context?: string
|
||||||
|
) {
|
||||||
|
let json = <string | QuestionableTagRenderingConfigJson>config
|
||||||
if (json === undefined) {
|
if (json === undefined) {
|
||||||
throw "Initing a TagRenderingConfig with undefined in " + context
|
throw "Initing a TagRenderingConfig with undefined in " + context
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue