Jeremy, Try replacing this code which now ignores layer 0 that is your point layer//Legend Addition
protected function initLegend():void
{
legendAC = new ArrayCollection([]);
ParcelData.getAllDetails(new AsyncResponder(allDtlsResult, allDtlsFault,"ParcelData"));
function allDtlsResult(event:AllDetails,lname:String):void
{
for each (var lDetails:LayerDetails in event.layersDetails){
if(lDetails.id > 0){
if(lDetails.drawingInfo){
//Add the layers name
var layName:Object = {
lname: lname,
id: lDetails.id,
otype: "layerName",
label: lDetails.name,
minscale: lDetails.minScale,
maxscale: lDetails.maxScale,
rend: null
}
legendAC.addItem(layName);
if(lDetails.drawingInfo.renderer is com.esri.ags.renderers.UniqueValueRenderer)
{
var uv:UniqueValueRenderer = lDetails.drawingInfo.renderer as UniqueValueRenderer;
for (var i:int=0; i<uv.infos.length; i++)
{
var uvObj:Object = {
lname: lname,
id: lDetails.id,
parentlabel: lDetails.name,
minscale: lDetails.minScale,
maxscale: lDetails.maxScale,
rend: uv.infos
}
legendAC.addItem(uvObj);
}
}
if(lDetails.drawingInfo.renderer is com.esri.ags.renderers.SimpleRenderer)
{
var simObj:Object = {
lname: lname,
id: lDetails.id,
parentlabel: lDetails.name,
minscale: lDetails.minScale,
maxscale: lDetails.maxScale,
rend: lDetails.drawingInfo.renderer
}
legendAC.addItem(simObj);
}
if(lDetails.drawingInfo.renderer is com.esri.ags.renderers.ClassBreaksRenderer)
{
var cb:ClassBreaksRenderer = lDetails.drawingInfo.renderer as ClassBreaksRenderer;
for (var j:int=0; j<cb.infos.length; j++)
{
var cbObj:Object = {
lname: lname,
id: lDetails.id,
parentlabel: lDetails.name,
minscale: lDetails.minScale,
maxscale: lDetails.maxScale,
rend: cb.infos
}
legendAC.addItem(cbObj);
}
}
}
}
}
}
function allDtlsFault(event:FaultEvent):void
{
Alert.show(event.message.toString());
}
}
//End Legend Addition