LegendRect: IGxRectF;
LegendRect: Prognoz.Platform.Interop. 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.
Executing the example requires a form containing the button component with the button1 identifier, the mapBoxNet component with the mapBoxNet1 identifier and the uiMapNet component with the uiMapNet1 identifier. Specify the uiMapNet1 data source for the mapBoxNet1 component, the data source must be set to display legend on the map.
The example is the Click event handler for the button1 component.
Imports Prognoz.Platform.Interop.Map;
Imports Prognoz.Platform.Interop.Drawing;
…
Private Sub button1_Click(sender: System.Object; e: System.EventArgs);
Var
LegRect: IGxRectF;
RectF: GxRectF = New GxRectFClass();
Begin
LegRect := RectF.Create(0.7, 0.8, 1, 1);
UiMap1.Map.View.LegendRect := LegRect;
End Sub;
The result of Fore.NET example execution matches with that in the Fore example.
See also: