IMapLegend.BeginUpdate

Syntax

BeginUpdate;

Description

The BeginUpdate method stops legend rendering.

Comments

The rendering can be resumed by calling the IMapTerritoryInfo.EndUpdate method.

Example

To execute the example the repository must contain a regular report with the REPORT identifier. The map containing only map indicator must be added to the regular report.

Add links to the Map, Metabase Report,Tab system assemblies.

Sub UserProc;
Var
    MB: IMetabase;
    Report: IPrxReport;
    Sheet: IPrxSheet;
    Table: IPrxTable;
    Objects: ITabObjects;
    Map: IMap;
    Layer: IMapLayer;
    Legend: IMapLegend;
Begin
    // Get repository
    MB := MetabaseClass.Active;
    // Get regular report
    Report := MB.ItemById("REPORT").Edit As IPrxReport;
    // Get map from regular report
    Sheet := Report.Activesheet;
    Table := Sheet As IPrxTable;
    Objects := Table.TabSheet.Objects;
    Map := Objects.Item(0).Extension As IMap;
    // Add map legend
    Legend := New DxMapLegend.Create As IMapLegend;
    Map.View.Legend := Legend;
    Legend.Visible := True;
    // Stop map rendering
    Legend.BeginUpdate;
    // Display the No Data element in the first place in legend
    Layer := Map.Layers.FindByName("Regions");
    Legend.Visual := Layer.Visuals.Item(0);
    Legend.NoDataElementFirst := True;
    Legend.NoDataElementVisible := True;
    // Resume map rendering
    Legend.EndUpdate;
    //Save changes
    (Report As IMetabaseObject).Save;
End Sub UserProc;

After executing the example the legend containing the No Data element on the first position is displayed for the map indicator:

The legend drawing is stopped for the parameters update period.

See also:

IMapLegend