Tree: string;
The Tree property returns the topobase tree-structure.
The tree-structure used by means of the ITopobase.GetSpecificTopobase method can be used to create custom topobases based on the existing topobases.
Executing the example requires the form containing the MapBox component with MapBox1 name and the UiMap component with UiMap1 identifier. The map must be loaded in the UiMap1 component and the component must be the data source for the MapBox1 component.
Add link to the Topobase system assembly.
Sub UserProc;
Var
Map: IMap;
Topo, SpecTopo: ITopobase;
Tree: String;
Begin
// Get map
Map := UiMap1.Map;
// Get topobase
Topo := Map.Topobase As ITopobase;
// Get topobase tree-structure
Tree := Topo.Tree;
// Display it to the console window
Debug.WriteLine(Tree);
// Set new tree-structure for topobase
Tree := "<Topobase><Layer Name=" + """" + "RootLayer" + """" + " Id=" + """" + "1" + """" +
"><Layer Name=" + """" + "Regions" + """" + " Id=" + """" + "2" + """" +
"><Shape Name=" + """" + "Republic Adygea" + """" + " Id=" + """" + "135" + """" + "/></Layer></Layer></Topobase>";
// Get topobase based on the new tree-structure
SpecTopo := Topo.GetSpecificTopobase(Tree, True);
// Display the new topobase in the UiMap1 component
Map.Topobase := SpecTopo As IMapTopobase;
End Sub UserProc;
After executing the example the zoomed fragment of the initial map will be displayed in the UiMap1 component.
See also: