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 determine a map legend, use the IMapView.Legend property.
Executing the example requires a form with the following components: the Button component named Button1, the MapBox component named MapBox1, and the UiMap component named UiMap1. UiMap1 is a data source for MapBox1. The map must be connected to the UiMap1 component.
The example is a handler of the OnClick event for the Button1 component.
Add links to the Drawing, ExtCtrls, Forms, and Map system assemblies.
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: