Fix merge

This commit is contained in:
Pieter Vander Vennet 2023-10-02 01:23:43 +02:00
parent 0c9a4576c0
commit d6cd0516bb
7 changed files with 30 additions and 52 deletions

View file

@ -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",
"source": "special",
"isShown": {

View file

@ -648,5 +648,6 @@
"render": "{all_tags()}"
}
],
"mapRendering": null
"lineRendering": null,
"pointRendering": null
}

View file

@ -391,9 +391,8 @@
"pointRendering": [
{
"icon": "./assets/themes/waste_basket/waste_basket.svg",
"iconSize": {
"render": "40,40,center"
},
"iconSize": "40,40",
"anchor": "center",
"location": [
"point"
]

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

View file

@ -368,8 +368,7 @@ class ExpandTagRendering extends Conversion<
name +
": layer " +
layerName +
" not found. Maybe you meant on of " +
candidates.slice(0, 3).join(", ")
" not found for now, but ignoring as this is a bootstrapping run. "
)
} else {
errors.push(
@ -378,7 +377,7 @@ class ExpandTagRendering extends Conversion<
name +
": layer " +
layerName +
" not found. Maybe you meant on of " +
" not found. Maybe you meant one of " +
candidates.slice(0, 3).join(", ")
)
}

View file

@ -102,14 +102,15 @@ export default class PointRenderingConfig extends WithContextLoader {
)
}
}
this.iconSize = this.tr("iconSize", "40,40")
this.anchor = this.tr("anchor", "center")
this.label = this.tr("label", undefined)
this.rotation = this.tr("rotation", "0")
this.pitchAlignment = this.tr("pitchAlignment", "canvas")
this.iconSize = this.tr("iconSize", "40,40", context + ".iconsize")
this.anchor = this.tr("anchor", "center", context + ".anchor")
this.label = this.tr("label", undefined, context + ".label")
this.rotation = this.tr("rotation", "0", context + ".rotation")
this.pitchAlignment = this.tr("pitchAlignment", "canvas", context + ".pitchAlignment")
this.rotationAlignment = this.tr(
"rotationAlignment",
json.pitchAlignment === "map" ? "map" : "canvas"
json.pitchAlignment === "map" ? "map" : "canvas",
context + ".rotationAlignment"
)
}

View file

@ -18,6 +18,7 @@ import { FixedUiElement } from "../../UI/Base/FixedUiElement"
import { Paragraph } from "../../UI/Base/Paragraph"
import Svg from "../../Svg"
import Validators, { ValidatorType } from "../../UI/InputElement/Validators"
import { TagRenderingConfigJson } from "./Json/TagRenderingConfigJson"
export interface Icon {}
@ -76,7 +77,11 @@ export default class TagRenderingConfig {
public readonly labels: 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) {
throw "Initing a TagRenderingConfig with undefined in " + context
}