Markers: IVZMapChartMarkers;
Markers: Prognoz.Platform.Interop.Visualizators.VZMapChartMarkers;
The Markers property determines collection of map geolocation markers.
Geolocation marker is a point bound to territory. Markers enable the user to display items on the map that are required for a user, for example: shops or metro stations.
Executing the example requires a form contains the components:
EaxDocumentViewerBox named EaxDocumentViewerBox1.
UiErAnalyzer named UiErAnalyzer1 that is a data source for EaxDocumentViewerBox1.
Specify an express report with map as a data source for the UiErAnalyzer1 component. The report contains one dimension of geolocation objects and several geolocation markers.
Add links to the Drawing, Visualizators system assemblies.
Sub UserProc;
Var
Express: IEaxAnalyzer;
MapChart: IEaxMapChart;
VisMapChart: IVZMapChart;
Markers: IVZMapChartMarkers;
Marker, MarkerAdd: IVZMapChartMarker;
Color: IGxColor;
ToolTipStyle: IVZToolTipStyle;
Topo: IVZMapChartTopobase;
MetaInfo: IVZMapChartTopobaseMetaInfo;
LeftGeoItem, RightGeoItem: IVZMapChartTopobaseGeoItem;
Begin
// Get express report
Express := UiErAnalyzer1.ErAnalyzer;
// Get map as a visualizer
MapChart := Express.MapChart;
VisMapChart := MapChart.MapChart;
// Get collection of geolocation markers
Markers := VisMapChart.Markers;
// Get geolocation marker
Marker := Markers.Item(0);
// Create a new geolocation marker
MarkerAdd := New VZMapChartMarker.Create;
// Add created marker to collection
Markers.Add(MarkerAdd);
// Insert specified marker into the second position in the collection
Markers.InsertAt(2, MarkerAdd);
// Change marker identifier
Marker.MarkerId := "GeoMarker";
// Create a new tooltip style
ToolTipStyle := New VZToolTipStyle.Create;
// Change tooltip font color
Color := New GxColor.CreateRGB(120, 0, 120);
ToolTipStyle.FontColor := Color;
// Apply style to tooltips of geolocation marker
Marker.ToolTipStyle := ToolTipStyle;
// Get map toppobase
Topo := VisMapChart.Topobase;
// Get topobase metadata
MetaInfo := Topo.Meta;
// Create new marker coordinates and apply them
LeftGeoItem := New VZMapChartTopobaseGeoItem.Create;
LeftGeoItem.Longitude := 50;
MetaInfo.GeoLeftBottom := LeftGeoItem;
RightGeoItem := New VZMapChartTopobaseGeoItem.Create;
RightGeoItem.Longitude := -50;
MetaInfo.GeoRightTop := RightGeoItem;
// Refresh map
MapChart.Refresh;
End Sub UserProc;
After executing the example:
A new geolocation marker is added to certain collection position.
Identifier of the obtained geolocation marker is changed.
Font color of geolocation marker tooltip is changed.
A binding area is created with new coordinates, geolocation marker is shifted according to the area size.
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.Drawing;
Imports Prognoz.Platform.Interop.Visualizators;
…
Private Sub UserProc();
Var
Express: IEaxAnalyzer;
MapChart: IEaxMapChart;
VisMapChart: IVZMapChart;
Markers: IVZMapChartMarkers;
Marker: IVZMapChartMarker;
MarkerAdd: VZMapChartMarker = New VZMapChartMarkerClass();
Color: GxColor = New GxColorClass_2();
ToolTipStyle: VZToolTipStyle = New VZToolTipStyleClass();
Topo: IVZMapChartTopobase;
MetaInfo: IVZMapChartTopobaseMetaInfo;
LeftGeoItem, RightGeoItem: VZMapChartTopobaseGeoItem = New VZMapChartTopobaseGeoItemClass();
Begin
// Get express report
Express := UiErAnalyzerNet1.ErAnalyzer.ErAnalyzer;
// Get map as a visualizer
MapChart := Express.MapChart;
VisMapChart := MapChart.MapChart;
// Get collection of geolocation markers
Markers := VisMapChart.Markers;
// Get geolocation marker
Marker := Markers.Item[0];
// Add created marker to collection
Markers.Add(MarkerAdd);
// Insert specified marker into the second position in the collection
Markers.InsertAt(2, MarkerAdd);
// Change marker identifier
Marker.MarkerId := "GeoMarker";
// Change tooltip font color
Color.CreateRGB(120, 0, 120);
ToolTipStyle.FontColor := Color;
// Apply style to tooltips of geolocation marker
Marker.ToolTipStyle := ToolTipStyle;
// Get map toppobase
Topo := VisMapChart.Topobase;
// Get topobase metadata
MetaInfo := Topo.Meta;
// Apply new coordinates
LeftGeoItem.Longitude := 50;
MetaInfo.GeoLeftBottom := LeftGeoItem;
RightGeoItem.Longitude := -50;
MetaInfo.GeoRightTop := RightGeoItem;
// Refresh map
MapChart.Refresh();
End Sub UserProc;
See also: