ESRI.ArcGIS.ADF.IMS
LabelPriority Constructor()
See Also  Example
ESRI.ArcGIS.ADF.IMS.Display.Renderer Namespace > LabelPriority Class > LabelPriority Constructor : LabelPriority Constructor()




Constructs a LabelPriority object.

Syntax

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

Example

The following example creates a LabelPriority with default priorities, modifies two location priorities, then uses the LabelPriority in a new SimpleLabelRenderer for an existing point layer.
Visual BasicCopy Code
' Create label priority with default placements

Dim labelPriority As New LabelPriority()

' Modify priorities of two locations around the label

labelPriority.Right = 0 ' No label directly right

labelPriority.LowerRight = 2 ' Increase priority of lower right



' Create label renderer, including symbol, and set label priority

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

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

simpleLabelRend.LabelPriority = labelPriority



' Set point layer to use the label renderer

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

layer.Renderer = simpleLabelRend

C#Copy Code
// Create label priority with default placements 

LabelPriority labelPriority = new LabelPriority(); 

// Modify priorities of two locations around the label 

labelPriority.Right = 0         // No label directly right 

labelPriority.LowerRight = 2    // Increase priority of lower right 

  

// Create label renderer, including symbol, and set label priority 

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

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

simpleLabelRend.LabelPriority = labelPriority; 

  

// Set point layer to use the label renderer 

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

layer.Renderer = simpleLabelRend; 

    

Remarks

If no values are set for the properties for priorities (UpperLeft, UpperCenter, etc.), then the default values will be used. See the class overview for discussion.

See Also

© 2010 All Rights Reserved.