Make the _constructRendererLegendElements method public

416
0
06-21-2022 02:29 AM
Status: Open
Labels (3)
MatthieuThery1
Occasional Contributor

Hello,

I was wondering if we could make the _constructRendererLegendElements from the ActiveLayerInfo class public, either as a method on this class or as a method on the LegendViewModel class.

The _constructRendererLegendElements takes a renderer and returns an ImageElement which allows us to show a legend even when the layer is not in the view.

That method does not need a layer at all actually, it only needs a renderer which is great. At the moment I am doing :

const activeLayer = new ActiveLayerInfo({ layer: new FeatureLayer() }) as ActiveLayerInfoExtended;
const legendElements = await activeLayer._constructRendererLegendElements(renderer);

which works, but obviously not super great as I have to extend the interface