IMapLayer.LabelHorizontalAlignment

Syntax

LabelHorizontalAlignment: MapLayerLabelHorizontalAlignment;

Description

The LabelHorizontalAlignment property determines horizontal position of map layer label relative to the position set in the topobase.

Comments

To determine vertical position of map layer label relative to the position set in the topobase, use IMapLayer.LabelVerticalAlignment.

Example

Executing the example requires that the repository contains a form with the components:

It is also required to have a regular report with a map with displayed layer labels in the repository. This map will be a data source for UiReport1.

Sub UserProc;
Var
    regrep: IPrxReport;
    sheet: IPrxSheet;
    table: IPrxTable;
    objects: ITabObjects;
    map: IMap;
    layer: IMapLayers;
    label: IMapLayer;
Begin
    // Get regular report
    regrep := UiReport1.Report;
    // Get map from regular report
    sheet := regrep.Activesheet;
    table := sheet As IPrxTable;
    objects := table.TabSheet.Objects;
    map := objects.Item(0).Extension As IMap;
    // Get collection of map layers
    layer := map.Layers;
    // Get layer
    label := layer.FindByName("Regions");
    // Change vertical position of label
    label.LabelVerticalAlignment := MapLayerLabelVerticalAlignment.Bottom;
    // Change horizontal position of label
    label.LabelHorizontalAlignment := MapLayerLabelHorizontalAlignment.Right;
    // Refresh map
   map.Refresh;
End Sub UserProc;

After executing the example labels of the Regions layer are displayed below and to the right relative to the position set in the topobase.

See also:

IMapLayer