IVZMapChartShape.Selected

Syntax

Selected: Boolean;

Selected: boolean;

Description

The Selected property determines whether map area is selected.

Comments

Available values:

Fore example

Executing the example requires that the repository contains an express report with the EXPRESS identifier. The express report must contain a map with the Regions layer.

Add links to the Drawing, Express, Metabase, Visualizators system assemblies.

Sub UserProc;
Var
    Metabase: IMetabase;
    EaxAnalyzer: IEaxAnalyzer;
    EMap: IVZMapChart;
    MapShape: IVZMapChartShape;
    Layer: IVZMapChartLayer;
    ShapeId: String;
    Color: IGxColor;
Begin
    // Get repository
    Metabase := MetabaseClass.Active;
    // Get express report
    EaxAnalyzer := Metabase.ItemById("EXPRESS").Edit As IEaxAnalyzer;
    // Get express report map as a visualizer
    EMap := EaxAnalyzer.MapChart.MapChart;
    // Get layer from map
    Layer := EMap.RootLayer.LayerById("Regions");
        //Select area
    ShapeId := Layer.Shapes.Item(20).ShapeId;
    MapShape := Layer.ShapeById(ShapeId);
    // Select area on map
    MapShape.Selected := True;
    // |Select area on map by changing border color
    Color := New GxColor.CreateRGB(85157170);
    MapShape.Border := New GxPen.CreateSolid(Color, 4);
    
// Set map layer area background without fill
    MapShape.IsStrokedShape := True;
    // Save express report
    (EaxAnalyzer As IMetabaseObject).Save;
End Sub UserProc;

Imports Prognoz.Platform.Interop.Drawing;
Imports Prognoz.Platform.Interop.Express;
Imports Prognoz.Platform.Interop.Visualizators;

Public Shared Sub Main(Params: StartParams);
Var
    Metabase: IMetabase;
    EaxAnalyzer: IEaxAnalyzer;
    EMap: IVZMapChart;
    MapShape: IVZMapChartShape;
    Layer: IVZMapChartLayer;
    ShapeId: String;
    Color: GxColor;
    Pen: GxPen;
Begin
    // Get repository
    Metabase := Params.Metabase;
    // Get express report
    EaxAnalyzer := Metabase.ItemById["EXPRESS"].Edit() As IEaxAnalyzer;
    // Get express report map as a visualizer
    EMap := EaxAnalyzer.MapChart.MapChart;
    // Get layer from map
    Layer := EMap.RootLayer.LayerById("Regions");
    // Select area
    ShapeId := Layer.Shapes.Item[20].ShapeId;
    MapShape := Layer.ShapeById(ShapeId);
    // Select area on map
    MapShape.Selected := True;
    // |Select area on map by changing border color
    Color := New GxColorClass_2.Create();
    Color.CreateRGB(85157170);
    Pen := New GxPenClass.Create();
    Pen.CreateSolid(Color, 4);
    MapShape.Border := Pen;
    // Set map layer area background without fill
    MapShape.IsStrokedShape := True;
    // Save express report
    (EaxAnalyzer As IMetabaseObject).Save();
End Sub

After executing the example, an area with specified identifier is marked on the map, area border color is changed, map layer area background is displayed without fill.

See also:

IVZMapChartShape