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




A Renderer object for displaying data with labels.

Object Model



Syntax

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

Example

The following example creates a SimpleLabelRenderer, sets some of its properties, and assigns the renderer to an existing map layer, in this case a line layer.
Visual BasicCopy Code
' Create label renderer, including symbol

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

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



' Set some properties for the label renderer

simpleLabelRend.FeatureWeight = Weight.Med_Weight

simpleLabelRend.LabelBufferRatio = 2.0

simpleLabelRend.LabelOccurrencePreference = LabelOccurrencePreference.One_Label_Per_Name

simpleLabelRend.LabelWeight = Weight.High_Weight

simpleLabelRend.LineLabelPosition = LineLabelPosition.PlaceAtStartAbove

simpleLabelRend.RotationalAngles = New Integer() {10, 15, 360}



' Assign the renderer to an existing map layer

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

layer.Renderer = simpleLabelRend

C#Copy Code
// Create label renderer, including symbol 

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

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

  

// Set some properties for the label renderer 

simpleLabelRend.FeatureWeight = Weight.Med_Weight; 

simpleLabelRend.LabelBufferRatio = 2.0; 

simpleLabelRend.LabelOccurrencePreference = LabelOccurrencePreference.One_Label_Per_Name; 

simpleLabelRend.LabelWeight = Weight.High_Weight; 

simpleLabelRend.LineLabelPosition = LineLabelPosition.PlaceAtStartAbove; 

simpleLabelRend.RotationalAngles = new int[] {10, 15, 360}; 

  

// Assign the renderer to an existing map layer 

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

layer.Renderer = simpleLabelRend; 

    

Remarks

This renderer displays simple labels in the same way for all features in a layer. Other label renderers allow more complex labeling or different labels for features based on attribute values. For a discussion, see the Renderer Class overview.

Inheritance Hierarchy

System.Object
   ESRI.ArcGIS.ADF.IMS.Display.Renderer.Renderer
      ESRI.ArcGIS.ADF.IMS.Display.Renderer.LabelRenderer
         ESRI.ArcGIS.ADF.IMS.Display.Renderer.SimpleLabelRenderer

See Also

© 2010 All Rights Reserved.