Hello,
I have a function that detects if a layer has a definitionExpression and then changes the color of the layer panel. It's working fine, except when I move the layer panels. Although I can see in the console that it gets the correct element, it does not update the color of the element.
I feel that when I move it, it creates another ID for the component and then changes it back after I finish moving.
reactiveUtils.watch(
() => layerList.operationalItems.map(item => item.layer),
(layers) => {
layers.map(layer => {
if (!excludedTitles.includes(layer.title) && layer["definitionExpression"]) {
const layerIdParts = layer.id?.split("-layer-");
const layerBaseId = layerIdParts ? layerIdParts[0] : '';
if (!layerBaseId) return;
const selector = `[data-layer-uid*="${layerBaseId}-object-"]`;
const layerListElement = document.querySelector(selector);
if (!layerListElement) return;
layerListElement.classList['add']("filter-list-panel");
}
});
}
);
Thanks