TOC Legend 4.x

1067
3
12-17-2021 09:37 AM
Status: Implemented
Labels (3)
RichardMoussopo
Occasional Contributor III

Would be nice to have the Legend similar to Legend in Desktop apps (ArcGIS Pro, ArcMap) as a widget in ArcGIS API for JavaScript. 

RichardMoussopo_1-1639762531931.png

 

 

Tags (2)
3 Comments
JuliePowell

Hi Richard, have you seen this sample? Does it meet your requirements?

https://developers.arcgis.com/javascript/latest/sample-code/widgets-layerlist-legend/

Julie

KristianEkenes

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"
    };
  }
});

 

BjornSvensson
Status changed to: Implemented

This was implemented in version 4.7 (April 2018).