ESRI.ArcGIS.ADF.IMS
ValueMapLabelRenderer Constructor()
See Also  Example
ESRI.ArcGIS.ADF.IMS.Display.Renderer Namespace > ValueMapLabelRenderer Class > ValueMapLabelRenderer Constructor : ValueMapLabelRenderer Constructor()




Constructs a ValueMapLabelRenderer.

Syntax

Visual Basic (Declaration) 
Public Function New()
Visual Basic (Usage)Copy Code
Dim instance As ValueMapLabelRenderer()
C# 
public ValueMapLabelRenderer()

Example

The following example creates a new ValueMapLabelRenderer for cities, adds three ranges for small, medium and large cities, sets different font size and color for each range, and assigns the new renderer to the cities map layer.
Visual BasicCopy Code
' Create a new ValueMapLabelRenderer and set value and label fields

Dim valueMapLblRend As New ValueMapLabelRenderer()

valueMapLblRend.ValueField = "POPULATION"

valueMapLblRend.LabelField = "NAME"



Dim textFont As FontInfo

Dim valueRange As LabelValueRange



' Create three value ranges, for three different city population sizes

valueRange = New LabelValueRange()

valueRange.MinValue = "1"

valueRange.MaxValue = "100000"

textFont = New FontInfo("Arial", 8, Drawing.Color.Blue, FontStyle.Regular)

valueRange.Symbol = New TextSymbol(textFont, TextCasing.None, Drawing.Color.Empty)

valueRange.SymbolLabel = "1 to 100,000"

valueMapLblRend.Values.Add(valueRange)



valueRange = New LabelValueRange()

valueRange.MinValue = "100000"

valueRange.MaxValue = "1000000"

textFont = New FontInfo("Arial", 12, Drawing.Color.Green, FontStyle.Regular)

valueRange.Symbol = New TextSymbol(textFont, TextCasing.None, Drawing.Color.Empty)

valueRange.SymbolLabel = "100,000 to 1,000,000"

valueMapLblRend.Values.Add(valueRange)



valueRange = New LabelValueRange()

valueRange.MinValue = "1000000"

valueRange.MaxValue = "50000000"

textFont = New FontInfo("Arial", 18, Drawing.Color.Red, FontStyle.Regular)

valueRange.Symbol = New TextSymbol(textFont, TextCasing.None, Drawing.Color.Empty)

valueRange.SymbolLabel = "Over 1,000,000"

valueMapLblRend.Values.Add(valueRange)



' Assign the ValueMapLabelRenderer to an existing point layer

Dim layer As FeatureLayer = mapView.Layers.FindByName("Cities")

layer.Renderer = valueMapLblRend

C#Copy Code
// Create a new ValueMapLabelRenderer and set value and label fields 

ValueMapLabelRenderer valueMapLblRend = new ValueMapLabelRenderer(); 

valueMapLblRend.ValueField = "POPULATION"; 

valueMapLblRend.LabelField = "NAME"; 

  

FontInfo textFont; 

LabelValueRange valueRange; 

  

// Create three value ranges, for three different city population sizes 

valueRange = new LabelValueRange(); 

valueRange.MinValue = "1"; 

valueRange.MaxValue = "100000"; 

textFont = new FontInfo("Arial", 8, Drawing.Color.Blue, FontStyle.Regular); 

valueRange.Symbol = new TextSymbol(textFont, TextCasing.None, Drawing.Color.Empty); 

valueRange.SymbolLabel = "1 to 100,000"; 

valueMapLblRend.Values.Add(valueRange); 

  

valueRange = new LabelValueRange(); 

valueRange.MinValue = "100000"; 

valueRange.MaxValue = "1000000"; 

textFont = new FontInfo("Arial", 12, Drawing.Color.Green, FontStyle.Regular); 

valueRange.Symbol = new TextSymbol(textFont, TextCasing.None, Drawing.Color.Empty); 

valueRange.SymbolLabel = "100,000 to 1,000,000"; 

valueMapLblRend.Values.Add(valueRange); 

  

valueRange = new LabelValueRange(); 

valueRange.MinValue = "1000000"; 

valueRange.MaxValue = "50000000"; 

textFont = new FontInfo("Arial", 18, Drawing.Color.Red, FontStyle.Regular); 

valueRange.Symbol = new TextSymbol(textFont, TextCasing.None, Drawing.Color.Empty); 

valueRange.SymbolLabel = "Over 1,000,000"; 

valueMapLblRend.Values.Add(valueRange); 

  

// Assign the ValueMapLabelRenderer to an existing point layer 

FeatureLayer layer = mapView.Layers.FindByName("Cities"); 

layer.Renderer = valueMapLblRend; 

    

Remarks

If you use this form of the constructor, remember to set the ValueField and LabelField properties. If not set, a runtime error will be thrown.

See Also

© 2010 All Rights Reserved.