ResetFormats;
ResetFormats();
The ResetFormats method resets settings for legend elements.
To set up legend elements, use the properties: IMapLegendLabelFormat.Between, IMapLegendLabelFormat.Equal, IMapLegendLabelFormat.Greater, IMapLegendLabelFormat.Less, IMapLegendLabelFormat.NoData.
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. Set the UiMap1 data source for the MapBox1 component.
The express report with a map containing the layer with the EOmap identifier is used as a data source.
The example is the OnClick event handler for the Button1 component.
Add links to the Express, ExtCtrls, Map system assemblies.
Sub Button1OnClick(Sender: Object; Args: IMouseEventArgs);
Var
Map: IMap;
Layer: IMapLayer;
Legend: IMapLegend;
Begin
Map := UiMap1.Map;
Legend := New DxMapLegend.Create As IMapLegend;
Layer := Map.Layers.FindByName("EOmap");
Legend.Visual := Layer.Visuals.Item(0) As IMapVisual;
Legend.ResetFormats;
End Sub Button1OnClick;
After executing the example standard settings of labels format are returned for the map legend.
Executing the example requires a form containing the Button component with the Buttonn1 identifier, the MapBoxNet component with the MapBoxNet1 identifier and the UiMapNet component with the UiMapNet1 identifier. Set the UiMapNet1 data source for the MapBoxNet1 component.
The express report with a map containing the layer with the EOmap identifier is used as a data source.
The example is the Click event handler for the Button1 component.
Add a link to the Map system assembly.
Imports Prognoz.Platform.Interop.Map;
…
Private Sub button1_Click(sender: System.Object; e: System.EventArgs);
Var
Map: IMap;
Layer: IMapLayer;
Legend: IMapLegend;
Begin
Map := UiMapNet1.Map;
Legend := New DxMapLegend.Create() As IMapLegend;
Legend.Visible := True;
Layer := Map.Layers.FindByName["EOmap"];
Legend.Visual := Layer.Visuals.Item[0] As IMapVisual;
Legend.ResetFormats();
End Sub;
The result of Fore.NET example execution matches with that in the Fore example.
See also: