Update Legend for Dynamic Map Service

1213
2
03-13-2019 06:27 AM
CenterlineMapping
New Contributor III

Using Esri JavaScript API 3.27, we are giving end users the ability to change the symbology for dynamic map service map layers in a web app using the SymbolStyler.  Is it possible to update the legend for the dynamic map service layer after the user chooses a symbol and updates the layer symbology?  Is there any easy way or would we have to grab the symbol image from the symbol styler and replace the legend picture with the picture from the symbol styler dom element (is that possible)?  How does ArcGIS Online update the legend after users change dynamic map service layer symbology, for example a polyline, point, or polygon?  Thank you for any help or suggestions you may have.

Tags (1)
0 Kudos
2 Replies
RobertScheitlin__GISP
MVP Emeritus

Have you called Legend.refresh()?

0 Kudos
CenterlineMapping
New Contributor III

We are adding a legend node to the LayerList widget.  I'm not sure it works the same.  Below is a similar discussion post that explains how we are adding a legend node within the LayerList widget.  Then we allow a user to change the symbology of the dynamic map service layer.  After changing the symbology the legend image does not update to reflect the symbology chosen and shown in the map.

Reference to other discussion.

Show legend in Layer List widget by default 

0 Kudos