IMapTopobaseShape.Text

Fore Syntax

Text: String;

Fore Syntax

Text: string;

Description

The Text property determines an area label.

Comments

To output area value as label, use a data adapter:

  1. In data adaptor description, add a field to work with map factors of the IMapAreaVisual type, for example:

Public visual: IMapAreaVisual;

  1. In the work procedure of map area label, set value of this field.

  2. Set a data adapter for map factors.

  3. Set an area label using the data adapter.

For example:

Sub UserProc;
Var
    M: IMap;
    Layer: IMapLayer;
    Shape: IMapTopobaseShape;
    da: VisualDataAdapter;
Begin
    M := UiMap1.Map;
    Layer := M.Layers.FindByName("Regions");
    Shape := Layer.Shapes.Item(0);
    da := New VisualDataAdapter.Create;
    Layer.Visuals.AddAreaVisual;
    da.visual := Layer.Visuals.Item(0As IMapAreaVisual;
    da.visual.DataAdapter := da;
    Shape.Text := (da.visual.DataAdapter As IMapDynamicDataAdapter).Data(shape.Id, 1);
End Sub UserProc;

Fore Example

Executing the example requires a form containing a button with the Button1 identifier, the UiMap component with the UiMap1 identifier and the MapBox component containing a loaded map and being a data source for the UiMap1 component.

Sub UserProc;
Var
    M: IMap;
    Layer: IMapLayer;
    Shape: IMapTopobaseShape;
Begin
    M := UiMap1.Map;
    Layer := M.Layers.FindByName(
"Regions");
    Shape := Layer.Shapes.Item(
0);
    Shape.Text := 
"Region";
    Layer.TextVisible := 
True;
End Sub UserProc;

After executing the example on clicking the button the first area label Volga Region is displayed on the map.

Fore.NET Example

The requirements and result of the Fore.NET example execution match with those in the Fore example. Use Fore.NET analogs instead of Fore components.

Imports Prognoz.Platform.Interop.Map;

Private Sub UserProc();
Var
    M: IMap;
    Layer: IMapLayer;
    Shape: IMapTopobaseShape;
Begin
    M := uiMapNet1.Map;
    Layer := M.Layers.FindByName["Regions"];
    Shape := Layer.Shapes.Item[0];
    Shape.Text := "Region";
    Layer.TextVisible := True;
End Sub;

See also:

IMapTopobaseShape