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




axlString
Constructs a LabelPriority object out of a comma delimited string of priorities.

Syntax

Visual Basic (Declaration) 
Public Function New( _
   ByVal axlString As String _
)
Visual Basic (Usage)Copy Code
Dim axlString As String
 
Dim instance As LabelPriority(axlString)
C# 
public LabelPriority( 
   string axlString
)

Parameters

axlString

Example

The following example creates a new label priority, where the label will be either drawn at the upper right or lower right. The label priority is associated with a new SimpleLabelRenderer, which is then set to the renderer for an existing point layer.
Visual BasicCopy Code
' Create label priority

Dim labelPriority As New LabelPriority("0,0,1,0,1,0,0,0")



' 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 

LabelPriority labelPriority = new LabelPriority("0,0,1,0,1,0,0,0"); 

  

// 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

LabelPriority accepts different weights for each of eight positions around a point. Each position corresponds to the positions as shown below:

1 2 3
8 x 4
7 6 5


In each position, you can prioritize the importance of that position from 0 to 8. 0 signifies that the label should not be placed in that position. 1 means that this is an acceptable position for the label, and all higher numbers represent lesser priorities for that position. For example, "1,0,1,0,0,0,0,0" means that only the first and third label positions will be taken into account when labeling. In another example, "1,2,3,0,1,0,0,0" means try to label at the first and fifth position; if not, then put the label at the second position; if not, then put it at the third position; if this is not possible, then don't label it.

To use this version of the constructor, include a string argument similar to the examples above, with eight comma-delimited values. Each value can be between 0 and 8.

If all eight property values are set to 0, then labels will be placed directly on top of the point. This is equivalent to calling SetPriority_LEPlaceOnTopHorizontal.

See Also

© 2010 All Rights Reserved.