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 |
---|
Dim labelPriority As New LabelPriority()
labelPriority.Right = 0
labelPriority.LowerRight = 2
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
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
See Also