dojo.connect(map,'onLayersAddResult',function(results){ var layerInfo = dojo.map(results, function(layer,index){ return {layer: abc,title: 'new legend'}; }); if(layerInfo.length > 0){ var legendDijit = new esri.dijit.Legend({ map:map, layerInfos:layerInfo },"legendDiv"); legendDijit.startup(); } });
Solved! Go to Solution.
You can use CSS (display:none; visibility:hidden) for the name of the layer. As for the second two lines I believe you can remove those in the symbology settings in the actual mxd/msd.