added icons to enabled layers

This commit is contained in:
Bavo Vanderghote 2020-07-22 11:56:40 +02:00
parent 0e3d9d930b
commit c56c076ab3

View file

@ -1,6 +1,7 @@
import { UIElement } from "./UIElement"; import { UIElement } from "./UIElement";
import { FilteredLayer } from "../Logic/FilteredLayer"; import { FilteredLayer } from "../Logic/FilteredLayer";
import { CheckBox } from "./Base/CheckBox"; import { CheckBox } from "./Base/CheckBox";
import Combine from "./Base/Combine";
export class LayerSelection extends UIElement{ export class LayerSelection extends UIElement{
@ -10,7 +11,10 @@ export class LayerSelection extends UIElement{
super(undefined); super(undefined);
this._checkboxes = []; this._checkboxes = [];
for (const layer of layers) { for (const layer of layers) {
this._checkboxes.push(new CheckBox(layer.isDisplayed, `isEnabled ${layer.layerDef.name}`, `isDisabled ${layer.layerDef.name}`)); this._checkboxes.push(new CheckBox(
layer.isDisplayed,
new Combine([layer.layerDef.name, `<img src="${layer.layerDef.icon}" alt="${layer.layerDef.icon}">`]),
layer.layerDef.name));
} }
} }