I am looking for the combination of Legend and Visibility Slider both in to the Layer List.
Code:
const layerList = new LayerList({
view: view,
listItemCreatedFunction: function (event) {
const item = event.item;
item.panel = {
content: "legend",
open: true
};
const slider = new Slider({
min: 0,
max: 1,
precision: 2,
values: [ 1 ],
visibleElements: {
labels: true,
rangeLabels: true
}
});
item.panel = {
content: slider,
className: "esri-icon-sliders-horizontal",
title: "Change layer opacity"
};
}
});Is it possible? if yes, Please share the code.