Is there a way to control the size of a Legend object?

385
3
01-18-2024 10:39 AM
Josh-R
by
New Contributor III

Is there a way to control the size of a Legend object? For example, can you control the symbol size, bounding  box, or make the legend responsive in some way? Thanks!

Tags (1)
0 Kudos
3 Replies
Sage_Wall
Esri Contributor

Hi @Josh-R , thanks for asking this question. Unfortunately, at this time, there isn't any documented and supported way to control the symbol size or bounding box or to make the legend responsive. It is on our roadmap (without an assigned release yet) to implement more control over the layout and size of legend items. I'd caution against creating a bunch of custom CSS rules to do so at this time. We are refactoring the SDK widgets to use the Calcite design system, and when that happens to the Legend widget, it will break all of your hard work.

Josh-R
by
New Contributor III

Thanks for the response @Sage_Wall! Glad to know its on the roadmap! It's not a showstopper right now, but I look forward to the new functionality when it releases.

0 Kudos
Sage_Wall
Esri Contributor

I should have mentioned there is a card style if you are looking for a better experience on smaller screens.  It's not the fine grained control over the individual ActiveLayerInfos objects I think your looking for but it is an option. It's smaller and shows one layer at a time and you page through them. https://codepen.io/sagewall/pen/poYPqMv

 

0 Kudos