MarkerSize: Double;
The MarkerSize property determines legend marker size.
To determine legend marker type, use IMapLegend.MarkerType.
Executing the example requires a form with the following components: the Button component named Button1, the ReportBox component named ReportBox1, and the UiErAnalyzer component named UiErAnalyzer1. UiReport1 is a data source for ReportBox1. It is also required to have a regular report containing a map with enabled legend that is a data source for UiReport1.
Add links to the Drawing, Map, Report, Tab system assemblies.
Sub UserProc;
Var
regrep: IPrxReport;
sheet: IPrxSheet;
table: IPrxTable;
objects: ITabObjects;
map: IMap;
legend: IMapLegend;
pad: IGxRectF;
Begin
// Get regular report
regrep := UiReport1.Report;
// Get map from regular report
sheet := regrep.Activesheet;
table := sheet As IPrxTable;
objects := table.TabSheet.Objects;
map := objects.Item(0).Extension As IMap;
// Get map legend
legend := map.View.Legend;
// Disable legend paddings on map
legend.AutoPadding := False;
// Create and set legend paddings
pad := New GxRectF.Create(1, 1, 1, 1);
legend.Padding := pad;
// Set position of elements by rows
legend.ElementPlacement := MapLegendElementPlacement.CustomRows;
// Set the number of legend rows
legend.RowCount := 4;
// Disable automatic paddings between element icons and labels
legend.SymbolSpaceAuto := False;
// Set padding between element icons and labels
legend.SymbolSpace := 2;
// Disable automatic padding between columns
legend.ColumnSpaceAuto := False;
// Set padding between columns
legend.ColumnSpace := 5;
// Disable automatic padding between rows
legend.RowSpaceAuto := False;
// Set padding between rows
legend.RowSpace := 2;
// Set right alignment of elements
legend.ElementsHorizontalAlign := MapHorizontalAlignment.Right;
// Set icon size
legend.MarkerSize := 10;
// Refresh map
map.Refresh;
End Sub UserProc;
After executing the example icon size and paddings between legend elements are increased, elements are aligned by the right edge.
See also: