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




A Renderer object that can display different symbologies.

Object Model



Syntax

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

Example

For an example of using this class with unique values, see the UniqueValue class . The following example renders a cities layer with three different symbols, based on population size. It first creates a new ValueMapRenderer, then creates three ValueRanges with symbols, and adds those to the ValueMapRenderer. Finally, it assigns the renderer to the cities layer.
Visual BasicCopy Code
' Create a new ValueMapRenderer and set value field

Dim valueMapRend As New ValueMapRenderer()

valueMapRend.ValueField = "POPULATION"



' Ranges below should cover all population sizes, but just in case we miss any...

valueMapRend.DefaultLabel = "Other"

valueMapRend.DefaultSymbol = New SimpleMarkerSymbol(Drawing.Color.Gray, 5)



Dim valueRange As ValueRange



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

valueRange = New ValueRange()

valueRange.MinValue = "1"

valueRange.MaxValue = "500000"

valueRange.SymbolLabel = "Under 500,000"

valueRange.Symbol = New SimpleMarkerSymbol(Drawing.Color.Teal, 5, MarkerSymbolType.Circle)

valueMapRend.Values.Add(valueRange)



valueRange = New ValueRange()

valueRange.MinValue = "500000"

valueRange.MaxValue = "5000000"

valueRange.SymbolLabel = "500,000 to 5,000,000"

valueRange.Symbol = New SimpleMarkerSymbol(Drawing.Color.Purple, 6, MarkerSymbolType.Square)

valueMapRend.Values.Add(valueRange)



valueRange = New ValueRange()

valueRange.MinValue = "5000000"

valueRange.MaxValue = "50000000"

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

valueRange.Symbol = New SimpleMarkerSymbol(Drawing.Color.Red, 20, MarkerSymbolType.Star)

valueMapRend.Values.Add(valueRange)



' Assign the ValueMapRenderer to an existing point layer

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

layer.Renderer = valueMapRend

C#Copy Code
// Create a new ValueMapRenderer and set value field 

ValueMapRenderer valueMapRend = new ValueMapRenderer(); 

valueMapRend.ValueField = "POPULATION"; 

  

// Ranges below should cover all population sizes, but just in case we miss any... 

valueMapRend.DefaultLabel = "Other"; 

valueMapRend.DefaultSymbol = new SimpleMarkerSymbol(Drawing.Color.Gray, 5); 

  

ValueRange valueRange; 

  

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

valueRange = new ValueRange(); 

valueRange.MinValue = "1"; 

valueRange.MaxValue = "500000"; 

valueRange.SymbolLabel = "Under 500,000"; 

valueRange.Symbol = new SimpleMarkerSymbol(Drawing.Color.Teal, 5, MarkerSymbolType.Circle); 

valueMapRend.Values.Add(valueRange); 

  

valueRange = new ValueRange(); 

valueRange.MinValue = "500000"; 

valueRange.MaxValue = "5000000"; 

valueRange.SymbolLabel = "500,000 to 5,000,000"; 

valueRange.Symbol = new SimpleMarkerSymbol(Drawing.Color.Purple, 6, MarkerSymbolType.Square); 

valueMapRend.Values.Add(valueRange); 

  

valueRange = new ValueRange(); 

valueRange.MinValue = "5000000"; 

valueRange.MaxValue = "50000000"; 

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

valueRange.Symbol = new SimpleMarkerSymbol(Drawing.Color.Red, 20, MarkerSymbolType.Star); 

valueMapRend.Values.Add(valueRange); 

  

// Assign the ValueMapRenderer to an existing point layer 

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

layer.Renderer = valueMapRend; 

    

Remarks

This renderer displays a layer with multiple symbols. Any number of symbols of the same type can be used to render the layer. Which symbol a particular feature uses is determined by the value of the feature in an attribute field, defined with ValueField. The value of the feature for the field is compared to the set of values in the Values collection. Each value item can be defined as a particular, unique value, or as a range of values. Unique values are typically used to render qualitative data, such by a field with name strings. Value ranges are used to render based on quantitative data, such as population numbers.

Not all values need to be covered within the Values collection. If the attribute value is not found in the Values collection, it is rendered using the DefaultSymbol. If the value is not within the Values collection and no default symbol is set, then the feature is not displayed with this renderer.

Inheritance Hierarchy

System.Object
   ESRI.ArcGIS.ADF.IMS.Display.Renderer.Renderer
      ESRI.ArcGIS.ADF.IMS.Display.Renderer.ValueMapRenderer

See Also

© 2010 All Rights Reserved.