Selected: Boolean;
Selected: boolean;
The Selected property determines whether map area is selected.
Available values:
True. Map area is selected.
False. Default value. Map area is not selected.
Executing the example requires that the repository contains an express report with the EXPRESS identifier.
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_MAP").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(85, 157, 170);
MapShape.Border := New GxPen.CreateSolid(Color, 4);
// Save express report
(EaxAnalyzer As IMetabaseObject).Save;
End Sub UserProc;
After executing the example the area with set identifier is selected on the map, area border color is changed.
The requirements and result of the Fore.NET example execution match with those in the Fore example.
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_MAP"].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(85, 157, 170);
Pen := New GxPenClass.Create();
Pen.CreateSolid(Color, 4);
MapShape.Border := Pen;
// Save express report
(EaxAnalyzer As IMetabaseObject).Save();
End Sub
See also: