Ian,
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.
Robert,
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.
Ian,
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
David,
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]
<*> [symbol]
✔ Water Line [layer]
------ [symbol]
✔ Sewer Group [group layer]
✔ Sewer Manhole [layer]
O [symbol]
✔ Sewer Line [layer]
------ [symbol]
Just curious if this is in 4.x now, or if I'm missing something. I do see several samples tagged with "TOC", including this one, but none that have the opacity slider. But I don't see anything about the legend in the layerlist properties or anything like that. Maybe I'm just not finding what I'm looking for?