ESRI.ArcGIS.ADF.IMS
GroupRenderer Constructor
See Also  Example
ESRI.ArcGIS.ADF.IMS.Display.Renderer Namespace > GroupRenderer Class : GroupRenderer Constructor




Constructs a GroupRenderer object.

Syntax

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

Example

The following example creates a two renderers (SimpleRenderer and SimpleLabelRenderer), adds them to a newly created GroupRenderer, and then assigns the GroupRenderer to an existing map layer.
Visual BasicCopy Code
' Create two renderers, one for symbol and one for labels

Dim symbol1 As New SimpleFillSymbol(Drawing.Color.LightYellow, Drawing.Color.Black, PolygonFillType.Solid)

Dim rend1 As New SimpleRenderer(symbol1)

Dim textSymb As New TextSymbol(New FontInfo("Verdana", 12, Drawing.Color.Navy, FontStyle.Regular), TextCasing.None, Drawing.Color.Empty)

Dim rend2 As New SimpleLabelRenderer("NAME", textSymb)



' Create a new GroupRenderer and add the renderers to it

Dim groupRend As New GroupRenderer()

groupRend.Renderers.Add(rend1)

groupRend.Renderers.Add(rend2)



' Retrieve an existing layer from MapView and assign the GroupRenderer to it

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

layer.Renderer = groupRend

C#Copy Code
// Create two renderers, one for symbol and one for labels 

SimpleFillSymbol symbol1 = new SimpleFillSymbol(Drawing.Color.LightYellow, Drawing.Color.Black, PolygonFillType.Solid); 

SimpleRenderer rend1 = new SimpleRenderer(symbol1); 

TextSymbol textSymb = new TextSymbol(new FontInfo("Verdana", 12, Drawing.Color.Navy, FontStyle.Regular), TextCasing.None, Drawing.Color.Empty); 

SimpleLabelRenderer rend2 = new SimpleLabelRenderer("NAME", textSymb); 

  

// Create a new GroupRenderer and add the renderers to it 

GroupRenderer groupRend = new GroupRenderer(); 

groupRend.Renderers.Add(rend1); 

groupRend.Renderers.Add(rend2); 

  

// Retrieve an existing layer from MapView and assign the GroupRenderer to it 

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

layer.Renderer = groupRend; 

    

See Also

© 2010 All Rights Reserved.