forked from MapComplete/MapComplete
Add composable icons, add icon badges and overlays, add icon badge to drinking water and cyclofix
This commit is contained in:
parent
4f7c25766a
commit
6299c8223e
13 changed files with 518 additions and 172 deletions
|
@ -5,6 +5,7 @@ import State from "../State";
|
|||
import Translations from "./i18n/Translations";
|
||||
import {FixedUiElement} from "./Base/FixedUiElement";
|
||||
import {VariableUiElement} from "./Base/VariableUIElement";
|
||||
import {UIEventSource} from "../Logic/UIEventSource";
|
||||
|
||||
export class LayerSelection extends UIElement {
|
||||
|
||||
|
@ -15,15 +16,15 @@ export class LayerSelection extends UIElement {
|
|||
this._checkboxes = [];
|
||||
|
||||
for (const layer of State.state.filteredLayers.data) {
|
||||
let iconUrl = "./asets/checkbox.svg";
|
||||
if (layer.layerDef.icon ) {
|
||||
iconUrl = layer.layerDef.icon.GetRenderValue({id:"node/-1"}).txt;
|
||||
}
|
||||
const icon = new FixedUiElement(`<img style="height:2em;max-width: 2em;" src="${iconUrl}">`);
|
||||
const leafletStyle = layer.layerDef.GenerateLeafletStyle(new UIEventSource<any>({id: "node/-1"}), true)
|
||||
const leafletHtml = leafletStyle.icon.html;
|
||||
const icon =
|
||||
new FixedUiElement(leafletHtml)
|
||||
.SetClass("single-layer-selection-toggle")
|
||||
let iconUnselected: UIElement = new FixedUiElement(leafletHtml)
|
||||
.SetClass("single-layer-selection-toggle")
|
||||
.SetStyle("opacity:0.2;");
|
||||
|
||||
let iconUnselected: UIElement;
|
||||
iconUnselected = new FixedUiElement(`<img style="height:2em;max-width: 2em; opacity:0.2;" src="${iconUrl}">`);
|
||||
|
||||
const name = Translations.WT(layer.layerDef.name).Clone()
|
||||
.SetStyle("font-size:large;margin-left: 0.5em;");
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue