Select to view content in your preferred language

Does the Layer List have a toggle to the legend in JS API 4.6?

2339
9
01-03-2018 02:44 PM
IanPeebles
Regular Contributor

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.

Tags (2)
0 Kudos
9 Replies
RobertScheitlin__GISP
MVP Emeritus

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.

IanPeebles
Regular Contributor

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.

RobertScheitlin__GISP
MVP Emeritus

Ian,

   I have not combined the layerList and Legend in any of my 4.x apps.

0 Kudos
DavidColey
Frequent Contributor

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

RobertScheitlin__GISP
MVP Emeritus

David,

   Your link is dead.

0 Kudos
DavidColey
Frequent Contributor

Thanks Robert I just edited the link should be working now

0 Kudos
KellyHutchins
Esri Frequent Contributor

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. 

Andy_Morgan
Occasional Contributor

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]

MikeDolbow
New Contributor III

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?