IMapNumericScale.AutoSetup

Syntax

AutoSetup(

Layer: IMapLayer;

DataAdapter:Object;

Values: Array;

Count: Integer;

Linear: Boolean);

Parameters

Layer - layer containing the indicator.

DataAdapter - data source that determines scale setup.

Values - array of real numbers used for scale tick mark values.

Count - number of scale tick marks.

Linear - parameter that determines setup type:

Description

The AutoSetup method executes the scale autoset.

Example

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.

Sub Button1OnClick(Sender: Object; Args: IMouseEventArgs);

Var

Map: IMap;

Layer: IMapLayer;

BarVisual: IMapBarVisual;

Height: IMapVisualNumericProperty;

Scale: IMapNumericScale;

Vals: Array[3] Of Double;

Begin

Map := UiMap1.Map;

Layer := Map.Layers.FindByName("Regions");

BarVisual := Layer.Visuals.AddBarVisual;

BarVisual.DataAdapter := New VisualDataAdapter.Create As IMapDynamicDataAdapter;

Height := BarVisual.Height;

Height.DataAdapter := BarVisual.DataAdapter;

Height.Dependent := True;

Scale := New DxMapNumericScale.Create As IMapNumericScale;

Vals[0] := 2;

Vals[1] := 4;

Vals[2] := 6;

Scale.AutoSetup(Layer, BarVisual.DataAdapter, Vals, 3, True);

Height.Scale := Scale;

End Sub Button1OnClick;

After executing the example the bar indicator, which height is determined using the scale, is added to the Regions layer. The scale autoset is executed.

See also:

IMapNumericScale