LegendRect: IGxRectF;
The LegendRect property determines a map area where a legend is placed. The area is determined as a rectangle, which dimensions can be changed in the range [0..1].
To get a map legend, use the IMapView.Legend property.
Executing the example requires a form containing the Button component with the Button1 identifier, the MapBox component with the MapBox1 identifier and the UiMap component with the UiMap1 identifier. Specify the UiMap1 data source for the MapBox1 component, the data source must be set to display a legend on the map.
The example is the OnClick event handler for the Button1 component.
Add a link to the Drawing system assembly.
Sub Button1OnClick(Sender: Object; Args: IMouseEventArgs);
Var
LegRect: IGxRectF;
Begin
LegRect := New GxRectF.Create(0.7, 0.8, 1, 1);
UiMap1.Map.View.LegendRect := LegRect;
End Sub Button1OnClick;
On clicking the button the legend is placed in the right lower corner of the map.
See also: