Does the Layer List have a toggle to the legend in JS API 4.6? (Sublayers/Legend). Users need to see symbology, not just check boxes. I cannot find the option.
Here is what I am looking for in the 4.6 API.
That ability/feature does not exist as of 4.6. There is nothing indicating that that feature will be added either. You best bet is to call esri tech support and start an enhancement request.
Oh man that is unfortunate. I am heading out to the Dev Summit in March and will find out more information. The layer list is nice, but end users have no idea what symbology they are looking at. I am not sure why not having the checklist and legend together is done by design.
Are you using 4.x API? Do any of your apps have a layer list/combo? I am still working in 3.23 for the most part. Thank you again for the feedback.
I have not combined the layerList and Legend in any of my 4.x apps.
Ian, you can take a look at my post here:
JSAPI 4.x LayerList and Legend Together
we have the legend symbols displaying as a trigger-action event
Your link is dead.
Thanks Robert I just edited the link should be working now
This capability will be added to 4.x in a future release. The plan is to allow legend and opacity slider to be placed in a list item.
Hi Kelly, I'm trying to understand if there is, or soon will be, a way to reproduce a combined TOC/Legend in 4.x before we migrate away from 3.x. The only shortcoming with the Add a Legend to LayerList sample is the limitation of only allowing top level visibility toggling (all or nothing for the map service). If I'm understanding you correctly, eventually we'll be able to create a LayerList and apply legend symbols per each individual sublayer. Is this coming any time soon, perhaps?
Here is my desired outcome using ESRI 4.x API widgets/classes. The ✔ represents a visibility on/off switch.
✔ City Utilities [top level map service]
✔ Water Group [group layer]
✔ Water Valve [layer]
✔ Water Line [layer]
✔ Sewer Group [group layer]
✔ Sewer Manhole [layer]
✔ Sewer Line [layer]
Retrieving data ...