Would be nice to have the Legend similar to Legend in Desktop apps (ArcGIS Pro, ArcMap) as a widget in ArcGIS API for JavaScript.
What was asked for and the response are not even close. The existing widget does not incorporate selectability or the actual symbology. What I am looking for is a widget that read the service and displays a legend that includes the layer list and legend features all in one without having to do much coding.
This was implemented in version 4.7 (April 2018).
Yes. This is already offered in the LayerList widget panels.
// displays the legend for each layer list item const layerList = new LayerList({ view: view, listItemCreatedFunction: function(event){ const item = event.item; item.panel = { content: "legend" }; } });
Hi Richard, have you seen this sample? Does it meet your requirements?
https://developers.arcgis.com/javascript/latest/sample-code/widgets-layerlist-legend/
Julie
Přihlaste se pro psaní příspěvků, sledování obsahu a další. Jste tu noví? Zaregistrujte se zdarma.