only show the legends of selected layers in layout control

Dec 6, 2011 at 8:43 PM

 In the source code of LayoutLegend.cs

Adding a condition in the function of (public virtual LayoutMap Map),

the layout control will only show the legends of selected layers.                       

foreach (IMapLayer t in Map.MapControl.Layers)                       

{                           

if(t.Checked)                             

_layers.Add(t);                       

}

Developer
Dec 6, 2011 at 10:34 PM

Does anyone have a comment on whether we need to add a property that would allow the user to determine whether to use all layers or only the checked ones?

Dec 6, 2011 at 10:44 PM
Edited Dec 6, 2011 at 10:58 PM

If not using this condition, the layout control will draw all legends including those unchecked layers.  It looks a little weird. 

It seems that it is better just using the checked layers.

Of course, this can be changed by users using the property page of layoutlegend control.

 

 

 

 

Developer
Mar 9, 2012 at 10:52 PM
This discussion has been copied to a work item. Click here to go to the work item and continue the discussion.