Constructs a GroupRenderer object.
Syntax
Visual Basic (Declaration) | |
---|
Public Function New() |
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 Basic | Copy 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; |
Requirements
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