diff --git a/Models/ThemeConfig/Json/TagRenderingConfigJson.ts b/Models/ThemeConfig/Json/TagRenderingConfigJson.ts
index 1ccf1c2f85..1074c81452 100644
--- a/Models/ThemeConfig/Json/TagRenderingConfigJson.ts
+++ b/Models/ThemeConfig/Json/TagRenderingConfigJson.ts
@@ -25,6 +25,11 @@ export interface TagRenderingConfigJson {
*/
labels?: string[]
+ /**
+ * A human-readable text explaining what this tagRendering does
+ */
+ description?: string | any
+
/**
* Renders this value. Note that "{key}"-parts are substituted by the corresponding values of the element.
* If neither 'textFieldQuestion' nor 'mappings' are defined, this text is simply shown as default value.
diff --git a/Models/ThemeConfig/LayerConfig.ts b/Models/ThemeConfig/LayerConfig.ts
index 0582c57ac7..1ecf1966f9 100644
--- a/Models/ThemeConfig/LayerConfig.ts
+++ b/Models/ThemeConfig/LayerConfig.ts
@@ -28,6 +28,9 @@ import {And} from "../../Logic/Tags/And";
import {Overpass} from "../../Logic/Osm/Overpass";
import Constants from "../Constants";
import {FixedUiElement} from "../../UI/Base/FixedUiElement";
+import Svg from "../../Svg";
+import {UIEventSource} from "../../Logic/UIEventSource";
+import {OsmTags} from "../OsmFeature";
export default class LayerConfig extends WithContextLoader {
@@ -191,8 +194,8 @@ export default class LayerConfig extends WithContextLoader {
this.doNotDownload = json.doNotDownload ?? false;
this.passAllFeatures = json.passAllFeatures ?? false;
this.minzoom = json.minzoom ?? 0;
- if(json["minZoom"] !== undefined){
- throw "At "+context+": minzoom is written all lowercase"
+ if (json["minZoom"] !== undefined) {
+ throw "At " + context + ": minzoom is written all lowercase"
}
this.minzoomVisible = json.minzoomVisible ?? this.minzoom;
this.shownByDefault = json.shownByDefault ?? true;
@@ -352,7 +355,7 @@ export default class LayerConfig extends WithContextLoader {
neededLayer: string;
}[] = []
, addedByDefault = false, canBeIncluded = true): BaseUIElement {
- const extraProps = []
+ const extraProps : (string | BaseUIElement)[] = []
extraProps.push("This layer is shown at zoomlevel **" + this.minzoom + "** and higher")
@@ -377,7 +380,11 @@ export default class LayerConfig extends WithContextLoader {
}
if (this.source.geojsonSource !== undefined) {
- extraProps.push("
This layer is loaded from an external source, namely `" + this.source.geojsonSource + "`")
+ extraProps.push(
+ new Combine([
+ Utils.runningFromConsole ? "
" : undefined,
+ "This layer is loaded from an external source, namely ",
+ new FixedUiElement( this.source.geojsonSource).SetClass("code")]));
}
} else {
extraProps.push("This layer can **not** be included in a theme. It is solely used by [special renderings](SpecialRenderings.md) showing a minimap with custom data.")
@@ -409,16 +416,16 @@ export default class LayerConfig extends WithContextLoader {
if (values == undefined) {
return undefined
}
- const embedded: (Link | string)[] = values.values?.map(v => Link.OsmWiki(values.key, v, true)) ?? ["_no preset options defined, or no values in them_"]
+ const embedded: (Link | string)[] = values.values?.map(v => Link.OsmWiki(values.key, v, true).SetClass("mr-2")) ?? ["_no preset options defined, or no values in them_"]
return [
new Combine([
new Link(
- "
",
- "https://taginfo.openstreetmap.org/keys/" + values.key + "#values"
+ Utils.runningFromConsole ? "
" : Svg.statistics_svg().SetClass("w-4 h-4 mr-2"),
+ "https://taginfo.openstreetmap.org/keys/" + values.key + "#values", true
), Link.OsmWiki(values.key)
- ]),
+ ]).SetClass("flex"),
values.type === undefined ? "Multiple choice" : new Link(values.type, "../SpecialInputElements.md#" + values.type),
- new Combine(embedded)
+ new Combine(embedded).SetClass("flex")
];
}))
@@ -427,18 +434,27 @@ export default class LayerConfig extends WithContextLoader {
quickOverview = new Combine([
new FixedUiElement("Warning: ").SetClass("bold"),
"this quick overview is incomplete",
- new Table(["attribute", "type", "values which are supported by this layer"], tableRows)
+ new Table(["attribute", "type", "values which are supported by this layer"], tableRows).SetClass("zebra-table")
]).SetClass("flex-col flex")
}
- const icon = this.mapRendering
- .filter(mr => mr.location.has("point"))
- .map(mr => mr.icon?.render?.txt)
- .find(i => i !== undefined)
- let iconImg = ""
- if (icon !== undefined) {
- // This is for the documentation, so we have to use raw HTML
- iconImg = `
`
+
+ let iconImg: BaseUIElement = new FixedUiElement("")
+
+ if (Utils.runningFromConsole) {
+ const icon = this.mapRendering
+ .filter(mr => mr.location.has("point"))
+ .map(mr => mr.icon?.render?.txt)
+ .find(i => i !== undefined)
+ // This is for the documentation in a markdown-file, so we have to use raw HTML
+ if (icon !== undefined) {
+ iconImg = new FixedUiElement(`
`)
+ }
+ } else {
+ iconImg = this.mapRendering
+ .filter(mr => mr.location.has("point"))
+ .map(mr => mr.GenerateLeafletStyle(new UIEventSource({id:"node/-1"}), false, {includeBadges: false}).html)
+ .find(i => i !== undefined)
}
let overpassLink: BaseUIElement = undefined;
@@ -467,7 +483,7 @@ export default class LayerConfig extends WithContextLoader {
new Title("Supported attributes", 2),
quickOverview,
...this.tagRenderings.map(tr => tr.GenerateDocumentation())
- ]).SetClass("flex-col")
+ ]).SetClass("flex-col").SetClass("link-underline")
}
public CustomCodeSnippets(): string[] {
diff --git a/Models/ThemeConfig/TagRenderingConfig.ts b/Models/ThemeConfig/TagRenderingConfig.ts
index 656d880de1..2b09c765e3 100644
--- a/Models/ThemeConfig/TagRenderingConfig.ts
+++ b/Models/ThemeConfig/TagRenderingConfig.ts
@@ -14,6 +14,8 @@ import List from "../../UI/Base/List";
import {MappingConfigJson, QuestionableTagRenderingConfigJson} from "./Json/QuestionableTagRenderingConfigJson";
import {FixedUiElement} from "../../UI/Base/FixedUiElement";
import {Paragraph} from "../../UI/Base/Paragraph";
+import spec = Mocha.reporters.spec;
+import SpecialVisualizations from "../../UI/SpecialVisualizations";
export interface Mapping {
readonly if: TagsFilter,
@@ -37,6 +39,7 @@ export default class TagRenderingConfig {
public readonly render?: TypedTranslation