Themes: allow to easily import tagrenderings and add a prefix key to all tags

This commit is contained in:
Pieter Vander Vennet 2025-04-21 02:51:41 +02:00
parent 4d9bdaf877
commit 01680f236c
9 changed files with 201 additions and 31 deletions

View file

@ -257,6 +257,7 @@ export default class SpecialVisualizations {
{
name: "key",
defaultValue: "opening_hours",
type: "key",
doc: "The tagkey from which the table is constructed.",
},
{
@ -284,6 +285,7 @@ export default class SpecialVisualizations {
args: [
{
name: "key",
type: "key",
defaultValue: "opening_hours",
doc: "The tagkey from which the opening hours are read.",
},
@ -324,6 +326,7 @@ export default class SpecialVisualizations {
args: [
{
name: "key",
type: "key",
doc: "The key of the tag to give the canonical text for",
required: true,
},
@ -412,6 +415,7 @@ export default class SpecialVisualizations {
args: [
{
name: "key",
type: "key",
doc: "The attribute to interpret as json",
defaultValue: "value",
},
@ -463,6 +467,7 @@ export default class SpecialVisualizations {
args: [
{
name: "key",
type: "key",
defaultValue: "value",
doc: "The key to look for the tags",
},
@ -470,9 +475,7 @@ export default class SpecialVisualizations {
constr(
state: SpecialVisualizationState,
tagSource: UIEventSource<Record<string, string>>,
argument: string[],
feature: Feature,
layer: LayerConfig
argument: string[]
): BaseUIElement {
const key = argument[0] ?? "value"
return new VariableUiElement(
@ -508,8 +511,7 @@ export default class SpecialVisualizations {
state: SpecialVisualizationState,
tagSource: UIEventSource<Record<string, string>>,
argument: string[],
feature: Feature,
layer: LayerConfig
feature: Feature
): BaseUIElement {
return new SvelteUIElement(DirectionIndicator, { state, feature })
},
@ -520,6 +522,7 @@ export default class SpecialVisualizations {
args: [
{
name: "key",
type: "key",
doc: "The attribute containing the degrees",
defaultValue: "_direction:centerpoint",
},