Icon(Index: Integer; Impact: MapScaleSettingImpact): IGxImage;
Index - scale tick mark index.
Impact - determines the position relative to the scale tick mark value.
The Icon property determines the icon for the specified scale tick mark value.
Executing the example requires a form, a button named Button1 on the form, the UiMap component named UiMap1 that is a data source for the MapBox component. The map must be connected to the UiMap1 component. The VisualDataAdapter class, that creates a dynamic data source, must also be implemented. The class example is contained in the IMapVisual.DataAdapter property description. The files "C:\Greater.gif", "C:\Exact.gif" and "C:\Less.gif", that contain the image, must be present in the file system.
Sub Button1OnClick(Sender: Object; Args: IMouseEventArgs);
Var
Map: IMap;
Layer: IMapLayer;
ImageVisual: IMapImageVisual;
ImageProp: IMapVisualIconProperty;
Scale: IMapIconScale;
Begin
Map := UiMap1.Map;
Layer := Map.Layers.FindByName("Regions");
ImageVisual := Layer.Visuals.AddImageVisual;
ImageVisual.DataAdapter := New VisualDataAdapter.Create As IMapDynamicDataAdapter;
ImageProp := ImageVisual.Image;
ImageProp.DataAdapter := ImageVisual.DataAdapter;
ImageVisual.Height.Value := 2;
ImageVisual.Width.Value := 2;
ImageProp.Dependent := True;
Scale := ImageProp.Scale;
Scale.Count := 1;
Scale.Value(0) := 50;
Scale.Icon(0, MapScaleSettingImpact.Greater) := GxImage.FromFile("C:\Greater.gif");
Scale.Icon(0, MapScaleSettingImpact.Exact) := GxImage.FromFile("C:\Exact.gif");
Scale.Icon(0, MapScaleSettingImpact.Less) := GxImage.FromFile("C:\Less.gif");
End Sub Button1OnClick;
After executing the example the icon indicator is added to the Regions layer. The indicator icon is determined by the scale:
The values greater than fifty are indicated with the icon; the values less than fifty - with the icon; the values equal to fifty - with the icon.
See also: