diff --git a/UI/Base/CheckBox.ts b/UI/Base/CheckBox.ts index fcf52cd..ba8085e 100644 --- a/UI/Base/CheckBox.ts +++ b/UI/Base/CheckBox.ts @@ -1,6 +1,7 @@ import {UIElement} from "../UIElement"; import {UIEventSource} from "../UIEventSource"; import { FilteredLayer } from "../../Logic/FilteredLayer"; +import Translations from "../../UI/i18n/Translations"; export class CheckBox extends UIElement{ @@ -24,9 +25,9 @@ export class CheckBox extends UIElement{ InnerRender(): string { if (this._data.data) { - return this._showEnabled; + return Translations.W(this._showEnabled).Render(); } else { - return this._showDisabled; + return Translations.W(this._showDisabled).Render(); } } diff --git a/UI/LayerSelection.ts b/UI/LayerSelection.ts new file mode 100644 index 0000000..973b26e --- /dev/null +++ b/UI/LayerSelection.ts @@ -0,0 +1,31 @@ +import { UIElement } from "./UIElement"; +import { FilteredLayer } from "../Logic/FilteredLayer"; +import { CheckBox } from "./Base/CheckBox"; + +export class LayerSelection extends UIElement{ + + private readonly _checkboxes: UIElement[]; + + constructor(layers: FilteredLayer[]) { + super(undefined); + this._checkboxes = []; + for (const layer of layers) { + this._checkboxes.push(new CheckBox(layer.isDisplayed, `isEnabled ${layer.layerDef.name}`, `isDisabled ${layer.layerDef.name}`)); + } + } + + InnerRender(): string { + let html = ``; + + for (const checkBox of this._checkboxes) { + const checkBoxHTML = checkBox.Render(); + const checkBoxListItem = `
Maplayers
-