Hello.
In my spatial query app, i've configured the legend to dynamically show only those layers which are present within a mapview. However, I was wondering if it was possible to go one step further and show only those features which have been filtered to the view?
For example, even though this point has no features intersecting with it (and thus filtered), a layer shows up in the legend due to being present in the mapview:


My legend is configured like this:
const legend = new Legend({
view: view
});
legend.hideLayersNotInCurrentView = true;
//Add expandable functionality to the legend
legendExpand = new Expand({
expandIcon: "layers",
view: view,
content: legend,
expanded: true
});Thank you.