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