Add cycle_highways theme, add configurable overpass backend as feature switch (settable via theme and URL)

This commit is contained in:
Pieter Vander Vennet 2021-08-23 15:48:42 +02:00
parent f4ea36de9a
commit ef0826ebb6
21 changed files with 377 additions and 48 deletions

View file

@ -50,21 +50,26 @@ export default class Table extends BaseUIElement {
let row = this._contents[i];
const tr = document.createElement("tr")
for (let j = 0; j < row.length; j++) {
let elem = row[j];
const htmlElem = elem?.ConstructElement()
if (htmlElem === undefined) {
continue;
}
try {
let style = undefined;
if (this._contentStyle !== undefined && this._contentStyle[i] !== undefined && this._contentStyle[j] !== undefined) {
style = this._contentStyle[i][j]
}
let elem = row[j];
const htmlElem = elem?.ConstructElement()
if (htmlElem === undefined) {
continue;
}
const td = document.createElement("td")
td.style.cssText = style;
td.appendChild(htmlElem)
tr.appendChild(td)
let style = undefined;
if (this._contentStyle !== undefined && this._contentStyle[i] !== undefined && this._contentStyle[j] !== undefined) {
style = this._contentStyle[i][j]
}
const td = document.createElement("td")
td.style.cssText = style;
td.appendChild(htmlElem)
tr.appendChild(td)
} catch (e) {
console.error("Could not render an element in a table due to", e, row[j])
}
}
table.appendChild(tr)
}

View file

@ -14,6 +14,9 @@ export default class Translations {
if (typeof (s) === "string") {
return new FixedUiElement(s);
}
if(typeof s === "number"){
return new FixedUiElement(""+s)
}
return s;
}