Show contents 

Visualizators > Visualizators Assembly Interfaces > IVZMapChart > IVZMapChart.Markers

IVZMapChart.Markers

Syntax

Markers: IVZMapChartMarkers;

Description

The Markers property determines the collection of map geolocation markers.

Comments

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.

Example

Executing the example requires a form contains the components:

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 geolocation markers collection
    Markers := VisMapChart.Markers;
    // Get geolocation marker
    Marker := Markers.Item(0);
    // Create a new geolocation marker
    MarkerAdd := New VZMapChartMarker.Create;
    // Add the created marker to the collection
    Markers.Add(MarkerAdd);
    // Insert specified marker to the second position in the collection
    Markers.InsertAt(2, MarkerAdd);
    // Change marker identifier
    Marker.MarkerId := "GeoMarker";
    // Create a new style for tooltips
    ToolTipStyle := New VZToolTipStyle.Create;
    // Change tooltip font color
    Color := New GxColor.CreateRGB(1200120);
    ToolTipStyle.FontColor := Color;
    // Apply style to geolocation marker tooltips
    Marker.ToolTipStyle := ToolTipStyle;
    // Get map topobase
    Topo := VisMapChart.Topobase;
    // Get topobase metadata
    MetaInfo := Topo.Meta;
    // Create new coordinates of marker 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:

See also:

IVZMapChart