Greetings,I have the following code to start my legend:function addLegend(){
dojo.connect(map,'onLayerAdd', function(results){
var legend = new esri.dijit.Legend({
map:map,
layerInfos:legendLayers
},"legendDiv");
legend.startup();
});
}
When I first load my web app, the legend reads, "No Legend", even though I've successfully added layers to my map. Oddly enough, when I mouse wheel to zoom in or out, the legend loads properly. Similarly, when I use the checkboxes I have to turn other layers on an off, nothing changes in the legend... but when I zoom in or out the legend properly updates.Could anybody explain this behavior?Thanks,DR