MarkerSize: Double;
MarkerSize: double;
The MarkerSize property determines legend marker size.
To determine legend marker type, use IMapLegend.MarkerType.
Executing the example requires that the repository contains a form containing the components:
ReportBox with the ReportBox1 identifier.
UiReport with the UiReport1 identifier that 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 automatic legend paddings on the 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 quality 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 alignment of elements by the right edge
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.
The requirements and result of the Fore.NET example execution match with those in the Fore example. Use Fore.NET analogs instead of Fore components.
Imports Prognoz.Platform.Interop.Drawing;
Imports Prognoz.Platform.Interop.Map;
Imports Prognoz.Platform.Interop.Report;
Imports Prognoz.Platform.Interop.Tab;
…
Public Sub UserProc();
Var
regrep: IPrxReport;
sheet: IPrxSheet;
table: IPrxTable;
objects: ITabObjects;
map: IMap;
legend: IMapLegend;
pad: GxRectF = New GxRectF();
Begin
// Get regular report
regrep := UiReportNet1.ReportUi.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 automatic legend paddings on the map
legend.AutoPadding := False;
// Create and set legend paddings
pad.Create(1, 1, 1, 1);
legend.Padding := pad;
// Set position of elements by rows
legend.ElementPlacement := MapLegendElementPlacement.mlepCustomRows;
// Set quality 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 alignment of elements by the right edge
legend.ElementsHorizontalAlign := MapHorizontalAlignment.mhaRight;
// Set icon size
legend.MarkerSize := 10;
// Refresh map
map.Refresh();
End Sub UserProc;
See also: