AnsweredAssumed Answered

Add Symbology Dynamic Layer List

Question asked by vwolfley on Jul 6, 2012
Latest reply on Aug 23, 2012 by vwolfley
I have been working with the sample data for JavaScript API to create a layer list of my map service.  It works great but I would like to add the layer symbology to the list also.  I am having trouble with this.  Any suggestions? This is the code that I am using currently.

function buildLayerList(layer) {         var items = dojo.map(layer.layerInfos,function(info,index){           if (info.defaultVisibility) {             visible.push(info.id);           }           return "<input type='checkbox' class='list_item'" + (info.defaultVisibility ? "checked=checked" : "") + "' id='" + info.id + "' onclick='updateLayerVisibility();' /><label for='" + info.id + "'>" + "&nbsp" + info.id + "&nbsp" + info.name + "</label>";         })          dojo.byId("layer_list").innerHTML = items.join(' ');

Outcomes