IMapTopobaseShapes.Item

Syntax

Item(Index: Integer): IMapTopobaseShape;

Parameters

Index. Area index.

Description

The Item property returns the collection area by its index.

Example

Executing the example requires a form with a button named Button1, the UiMap component named UiMap1 and the MapBox component. A map containing the Regions layer should be linked to the UiMap1 component.

Add a link to the Map system assembly.

Sub Button1OnClick(Sender: Object; Args: IMouseEventArgs);
Var
    Map: IMap;
    Layer: IMapLayer;
    Shapes: IMapTopobaseShapes;
    Shape: IMapTopobaseShape;
    i, c: Integer;
Begin
    Map := UiMap1.Map;
    Layer := Map.Layers.FindByName("Regions");
    Shapes := Layer.Shapes;
    c := Shapes.Count;
    For i := 0 To c - 1 Do
        Shape := Shapes.Item(i);
        Debug.WriteLine(Shape.Name + " (ID=" + Shape.Id.ToString + ')');
    End For;
End Sub Button1OnClick;

After executing the example the development environment console displays names and numeric identifiers of all areas of the Regions layer.

See also:

IMapTopobaseShapes