ESRI.ArcGIS.ADF.IMS
UniqueLabelValue Class
Members  Example  See Also 
ESRI.ArcGIS.ADF.IMS.Display.Renderer Namespace : UniqueLabelValue Class




A class that represents an exact value in ValueMapLabelRenderer.

Object Model


Syntax

Visual Basic (Declaration) 
<SerializableAttribute()>
Public Class UniqueLabelValue 
   Inherits LabelValue
Visual Basic (Usage)Copy Code
Dim instance As UniqueLabelValue
C# 
[SerializableAttribute()]
public class UniqueLabelValue : LabelValue 

Example

The following example displays the names of capitals and non-capitals with different font and label characteristics. A ValueMapLabelRenderer is created, and two UniqueLabelValue objects are created, one for capitals and one for non-capitals. These are added to the renderer, and the renderer is assigned to the existing cities layer.
Visual BasicCopy Code
' Create a new ValueMapLabelRenderer and set value and label fields

Dim valueMapLblRend As New ValueMapLabelRenderer()

valueMapLblRend.ValueField = "CAPITAL"

valueMapLblRend.LabelField = "NAME"



Dim textFont As FontInfo

Dim uniqueValue As UniqueLabelValue



' Create unique values for capitals and non-capitals

uniqueValue = New UniqueLabelValue()

uniqueValue.Value = "Y"

uniqueValue.SymbolLabel = "Capital"

uniqueValue.ComparisonMethod = ComparisonMethod.IsExact

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

uniqueValue.Symbol = New TextSymbol(textFont, TextCasing.AllUpper, Drawing.Color.Empty)

valueMapLblRend.Values.Add(uniqueValue)



uniqueValue = New UniqueLabelValue()

uniqueValue.Value = "N"

uniqueValue.SymbolLabel = "Non-capital"

uniqueValue.ComparisonMethod = ComparisonMethod.IsExact

textFont = New FontInfo("Arial", 11, Drawing.Color.Gray, FontStyle.Regular)

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

valueMapLblRend.Values.Add(uniqueValue)



' 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 = "CAPITAL"; 

valueMapLblRend.LabelField = "NAME"; 

  

FontInfo textFont; 

UniqueLabelValue uniqueValue; 

  

// Create unique values for capitals and non-capitals 

uniqueValue = new UniqueLabelValue(); 

uniqueValue.Value = "Y"; 

uniqueValue.SymbolLabel = "Capital"; 

uniqueValue.ComparisonMethod = ComparisonMethod.IsExact; 

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

uniqueValue.Symbol = new TextSymbol(textFont, TextCasing.AllUpper, Drawing.Color.Empty); 

valueMapLblRend.Values.Add(uniqueValue); 

  

uniqueValue = new UniqueLabelValue(); 

uniqueValue.Value = "N"; 

uniqueValue.SymbolLabel = "Non-capital"; 

uniqueValue.ComparisonMethod = ComparisonMethod.IsExact; 

textFont = new FontInfo("Arial", 11, Drawing.Color.Gray, FontStyle.Regular); 

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

valueMapLblRend.Values.Add(uniqueValue); 

  

// Assign the ValueMapLabelRenderer to an existing point layer 

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

layer.Renderer = valueMapLblRend; 

    

Remarks

Unique values are typically used for qualitative data, such as for rendering based a string field, for example, zoning type.

Inheritance Hierarchy

System.Object
   ESRI.ArcGIS.ADF.IMS.Display.Renderer.LabelValue
      ESRI.ArcGIS.ADF.IMS.Display.Renderer.UniqueLabelValue

See Also

© 2010 All Rights Reserved.