The type of the data to be used for assigning features to renderer groups (values).
ESRI.ArcGIS.ADF.Web Send comments on this topic.
Generic ValueMapRenderer Class
See Also  Members   Example 
ESRI.ArcGIS.ADF.Web.Display.Renderer Namespace : Generic ValueMapRenderer Class

A renderer that can display features in a graphics layer with multiple symbol types.

Object Model


Visual Basic (Declaration) 
Public Class ValueMapRenderer(Of T As IComparable(Of T)) 
   Implements IOverlayableRenderer, IRendererIJsonSerializable 
Visual Basic (Usage)Copy Code
Dim instance As ValueMapRenderer(Of T)
public class ValueMapRenderer<T> : IOverlayableRenderer, IRendererIJsonSerializable  where T: IComparable(Of T)

Type Parameters

The type of the data to be used for assigning features to renderer groups (values).


This example creates a new ValueMapRenderer, adds two symbol classes to it, and then uses the renderer for a new graphics layer added to the map. To run this sample on a page:

  • Create a new ASPX page.
  • Add MapResourceManager, Map and Toc controls and set required properties (Map's MapResourceManager, Toc's Map properties).
  • Add a resource item to the MapResourceManager with a map service, then add a second resource item with type GraphicsLayer with a name of "graphicsLayer0". Move the graphics resource to the top of the list of resources.
  • Add the sample code into the Page_PreRender event handler method (create this method if necessary).
  • Change the point x and y locations if necessary to fit within your map service's extent.
  • Run the sample page. Two point symbols will be added to the map display.
C#Copy Code
// Create new ValueMapRenderer 
ValueMapRenderer<int> vMapRend = new ValueMapRenderer<int>(); 
// Column in data table with data for rendering 
vMapRend.ValueColumnName = "Population"; 
SimpleMarkerSymbol sms; 
// Create a ValueRange for the first class 
ValueRange<int> valRange; 
valRange = new ValueRange<int>(); 
valRange.MinValue = 0; 
valRange.MaxValue = 100; 
valRange.Bounds = RangeBounds.Lower; 
sms = new SimpleMarkerSymbol 
    (System.Drawing.Color.Blue, 12); 
valRange.SymbolLabel = "Low"; 
valRange.Symbol = sms; 
// Create a ValueRange for the second class 
valRange = new ValueRange<int>(); 
valRange.MinValue = 100; 
valRange.MaxValue = 1000; 
valRange.Bounds = RangeBounds.Upper; 
sms = new SimpleMarkerSymbol( 
    System.Drawing.Color.Red, 15); 
valRange.Symbol = sms; 
valRange.SymbolLabel = "High"; 
// Create new graphics layer with two points 
FeatureGraphicsLayer grLayer = new FeatureGraphicsLayer( 
grLayer.GeometryColumnName = "geom"; 
grLayer.Columns.Add("Population", typeof(int)); 
DataRow graphicFeature; 
// First point 
graphicFeature = grLayer.NewRow(); 
graphicFeature["Population"] = 52; 
graphicFeature["geom"] =  
    new ESRI.ArcGIS.ADF.Web.Geometry.Point(-92.0, 45.0); 
// Second point 
graphicFeature = grLayer.NewRow(); 
graphicFeature["Population"] = 389; 
graphicFeature["geom"] = 
    new ESRI.ArcGIS.ADF.Web.Geometry.Point(36.0, -12.0); 
// Get the graphics resource from the Map/MapResourceManager 
ESRI.ArcGIS.ADF.Web.DataSources.Graphics.MapFunctionality graphicsFunct = 
    as ESRI.ArcGIS.ADF.Web.DataSources.Graphics.MapFunctionality; 
if (graphicsFunct != null) 

    ESRI.ArcGIS.ADF.Web.DataSources.Graphics.MapResource mapResource = 
        graphicsFunct.Resource as 
    // Add the graphics layer to the map 

Visual BasicCopy Code
' Create new ValueMapRenderer
Dim vMapRend As New ValueMapRenderer(Of Integer)()

' Column in data table with data for rendering
vMapRend.ValueColumnName = "Population"

Dim sms As SimpleMarkerSymbol

' Create a ValueRange for the first class
Dim valRange As New ValueRange(Of Integer)()
valRange.MinValue = 0
valRange.MaxValue = 100
valRange.Bounds = RangeBounds.Lower
sms = New SimpleMarkerSymbol(System.Drawing.Color.Blue, 12)
valRange.SymbolLabel = "Low"
valRange.Symbol = sms

' Create a ValueRange for the second class
valRange = New ValueRange(Of Integer)()
valRange.MinValue = 100
valRange.MaxValue = 1000
valRange.Bounds = RangeBounds.Upper
sms = New SimpleMarkerSymbol(System.Drawing.Color.Red, 15)
valRange.Symbol = sms
valRange.SymbolLabel = "High"

' Create new graphics layer with two points
FeatureGraphicsLayer grLayer = New FeatureGraphicsLayer( _
    "MyGraphicsLayer", _
    ESRI.ArcGIS.ADF.Web.FeatureType.Point, _
grLayer.GeomeTryColumnName = "geom"

grLayer.Columns.Add("Population", Type.GetType(Integer))

Dim graphicFeature As DataRow
' First point
graphicFeature = grLayer.NewRow()
graphicFeature("Population") = 52
graphicFeature("geom") = _
    New ESRI.ArcGIS.ADF.Web.GeomeTry.Point(-92.0, 45.0)

' Second point
graphicFeature = grLayer.NewRow()
graphicFeature("Population") = 389
graphicFeature("geom") = _
    New ESRI.ArcGIS.ADF.Web.GeomeTry.Point(36.0, -12.0)

' Get the graphics resource from the Map/MapResourceManager
Dim graphicsFunct As ESRI.ArcGIS.ADF.Web.DataSources.Graphics.MapFunctionality
graphicsFunct = CType(Map1.GetFunctionality("graphicsLayer0"), _
If graphicsFunct IsNot Nothing Then
    Dim mapResource As ESRI.ArcGIS.ADF.Web.DataSources.Graphics.MapResource
    mapResource = CType(graphicsFunct.Resource, _
    ' Add the graphics layer to the map
End If


A ValueMapRenderer is used to symbolize a FeatureGraphicsLayer with multiple symbol types. Features in the graphics layer are assigned to symbol classes based on the value in a column of the graphics layer. The name of this column in the graphics layer must be copied to the ValueColumnName of the ValueMapRenderer.

At least two value classes should be added to the Values collection of the ValueMapRenderer. Each class is of a type derived from Value: either ValueRange, StringValue or UniqueValue. The value classes in a single ValueMapRenderer should be all of the same type. A ValueRange has upper and lower boundaries for assigning features based on a numeric-type column. A StringValue is used to assign features based on a string-type column. A UniqueValue is used to assign features based on exact matches to values.

Each value class needs a Symbol to enable rendering the features in the graphics layer. The symbols used must be appropriate for the FeatureType of the FeatureGraphicsLayer. For example, a graphics layer with polygons may be symbolized using a SimpleFillSymbol.

A ValueMapRenderer may optionally have a default symbol and label. The default symbol is used to display features that do not fall into one of the categories covered in the Values collection.

The Values classes will also appear in the Toc (table of contents) when it has been buddied to the Map control. The symbol and label for each value will be displayed.

Inheritance Hierarchy



Target Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family, Windows Vista, Windows Server 2008 family

See Also

© 2009 All Rights Reserved.