import { UIElement } from "./UIElement"; import { FilteredLayer } from "../Logic/FilteredLayer"; import { CheckBox } from "./Input/CheckBox"; import Combine from "./Base/Combine"; import {Utils} from "../Utils"; import {Img} from "./Img"; import {State} from "../State"; export class LayerSelection extends UIElement { private readonly _checkboxes: UIElement[]; constructor() { super(undefined); this._checkboxes = []; for (const layer of State.state.filteredLayers.data) { const checkbox = ``; let icon = ""; if (layer.layerDef.icon && layer.layerDef.icon !== "") { icon = `` } const name = layer.layerDef.name; this._checkboxes.push(new CheckBox( new Combine([checkbox, icon, name]), new Combine([ Img.no_checkmark, icon, layer.layerDef.name]), layer.isDisplayed)); } } InnerRender(): string { let html = ``; for (const checkBox of this._checkboxes) { const checkBoxHTML = checkBox.Render(); const checkBoxListItem = `