BeginUpdate;
Executing the BeginUpdate method enables the user to stop territory info rendering.
All the territory info changes executed are not displayed until the IMapTerritoryInfo.EndUpdate method is called.
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 ExtCtrls, Forms, and Map system assemblies.
Sub Button1OnClick(Sender: Object; Args: IMouseEventArgs);
Var
Map: IMap;
TerrI: IMapTerritoryInfo;
Begin
// Determine a map
Map := UiMap1.Map;
TerrI := New DxMapTerritoryInfo.Create;
// Set territory info
Map.View.TerritoryInfo := TerrI;
// Determine the layer, on which territory info is displayed
TerrI.Layer := Map.Layers.FindByName("Regions");
// Stop territory rendering
TerrI.BeginUpdate;
// Enable displaying of territory info
TerrI.Visible:= True;
// Set maximum number of columns in territory info
TerrI.ColumnCount := 2;
// Set sorting parameters for territory info elements
TerrI.SortType := MapTerritoryInfoSortType.Code;
// Enable displaying of only visible territories on mao in territory info
TerrI.DisplayVisibleOnly := True;
// Resume territory rendering
TerrI.EndUpdate;
End Sub Button1OnClick;
After executing the example the territory info rendering is stopped, the elements are sorted by identifier and placed according to the specified maximum number of columns in the territory info. The territory info displays only visible territories on the map:

Then rendering is resumed.
See also: