Robert,In the process of converting from the 2.5 version of the Dynamic Legend Widget to 3.0 for use in the 3.0 Flex Viewer, I found that my tiled service was no longer in the legend. After troubleshooting this, I found a fix that I would like to submit for consideration.In the module LegendItemRenderer.mxml, in private function itemrenderer_dataChangeHandler(event:FlexEvent):void, I changed the commented line as shown here to include the lId parameter where there was no parameter.
if (layer is ArcGISDynamicMapServiceLayer){
layer.addEventListener(FlexEvent.SHOW,updateVisibilty);
layer.addEventListener(FlexEvent.HIDE,updateVisibilty);
if(!ArcGISDynamicMapServiceLayer(layer).visibleLayers){
visArr = buildVisibleLayers(ArcGISDynamicMapServiceLayer(layer).layerInfos);
}else{
visArr = ArcGISDynamicMapServiceLayer(layer).visibleLayers as ArrayCollection;
}
ChangeWatcher.watch(ArcGISDynamicMapServiceLayer(layer), "visibleLayers", updateVisibilty);
}else if (layer is FeatureLayer){
layer.addEventListener(FlexEvent.SHOW,updateVisibilty);
layer.addEventListener(FlexEvent.HIDE,updateVisibilty);
visArr = new ArrayCollection([lId]);
}else{
visArr = new ArrayCollection([lId]); // MDW change [] to [lId]
}
Robert -- do you agree with this? Thanks,Marc