I am using arc gis api for java script 3.16. We are facing issues for showing dynamically category wise legend. i have Draw categories using unique values of one field in symbology of layer property arc map 10.3.1 and than publish this .mxd file as a map service and this service use in my program and i want to show only those legend category symbol which are exist on map but my map show legend according to layer wise if layer is on legend show properly but i am showing only those symbol which value are exist on map not all.
i am using this code for showing legend.
var legend = new Legend({
map : map,
layerInfos : [ {
layer : layer,
title : "Legend"
} ]
}, "legend");
legend.startup();
Adarash,
There is no ability currently to have the legend only show the categories that exist in the current view.
Thank You Robert.
Rob,
How is it that the Print fucntion will show the legend that refelcts the data that is zoomed in? But, the actual legend does not update the same way?
Any updates for this?