Change legend name/title of layer in ArcGISDynamicMapServiceLayer

997
1
Jump to solution
08-07-2017 06:23 AM
GareySmiley
New Contributor III

I have a ArcGISDynamicMapServiceLayer layer that has a layer within it I am applying a createClassedColorRenderer to which is working great. I want to change the name/title that appears in the legend after I apply the renderer. So by default it appears as "State" as is defined in the MDX. I want to change it to something like "State by Market Share" after I apply the renderer. I can find examples of doing this to a feature layer, but not a layer within a ArcGISDynamicMapServiceLayer. Any hints would be appreciated. 

0 Kudos
1 Solution

Accepted Solutions
GareySmiley
New Contributor III

Okay figured this out

layer.layerInfos[0].name="New Legend Label";

will change inner layer 0's legend label to "New Legend Label". 

View solution in original post

1 Reply
GareySmiley
New Contributor III

Okay figured this out

layer.layerInfos[0].name="New Legend Label";

will change inner layer 0's legend label to "New Legend Label".