forked from MapComplete/MapComplete
Merge master
This commit is contained in:
commit
aa50d33b81
53 changed files with 1094 additions and 411 deletions
|
@ -187,7 +187,7 @@ export default class LayerConfig {
|
|||
|
||||
const keys = Array.from(SharedTagRenderings.SharedTagRendering.keys())
|
||||
|
||||
throw `Predefined tagRendering ${renderingJson} not found in ${context}.\n Try one of ${(keys.join(", "))}`;
|
||||
throw `Predefined tagRendering ${renderingJson} not found in ${context}.\n Try one of ${(keys.join(", "))}\n If you intent to output this text literally, use {\"render\": <your text>} instead"}`;
|
||||
}
|
||||
return new TagRenderingConfig(renderingJson, self.source.osmTags, `${context}.tagrendering[${i}]`);
|
||||
});
|
||||
|
@ -343,7 +343,7 @@ export default class LayerConfig {
|
|||
|
||||
const iconW = num(iconSize[0]);
|
||||
let iconH = num(iconSize[1]);
|
||||
const mode = iconSize[2] ?? "center"
|
||||
const mode = iconSize[2]?.trim()?.toLowerCase() ?? "center"
|
||||
|
||||
let anchorW = iconW / 2;
|
||||
let anchorH = iconH / 2;
|
||||
|
@ -365,12 +365,6 @@ export default class LayerConfig {
|
|||
const self = this;
|
||||
const mappedHtml = tags.map(tgs => {
|
||||
function genHtmlFromString(sourcePart: string): BaseUIElement {
|
||||
if (sourcePart.indexOf("html:") == 0) {
|
||||
// We use § as a replacement for ;
|
||||
const html = sourcePart.substring("html:".length)
|
||||
const inner = new FixedUiElement(SubstitutingTag.substituteString(html, tgs)).SetClass("block w-min text-center")
|
||||
return new Combine([inner]).SetClass("flex flex-col items-center");
|
||||
}
|
||||
|
||||
const style = `width:100%;height:100%;transform: rotate( ${rotation} );display:block;position: absolute; top: 0; left: 0`;
|
||||
let html: BaseUIElement = new FixedUiElement(`<img src="${sourcePart}" style="${style}" />`);
|
||||
|
@ -432,7 +426,7 @@ export default class LayerConfig {
|
|||
try {
|
||||
|
||||
const label = self.label?.GetRenderValue(tgs)?.Subs(tgs)
|
||||
?.SetClass("block w-min text-center")
|
||||
?.SetClass("block text-center")
|
||||
?.SetStyle("margin-top: " + (iconH + 2) + "px")
|
||||
if (label !== undefined) {
|
||||
htmlParts.push(new Combine([label]).SetClass("flex flex-col items-center"))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue