![]() ![]() |
ESRI.ArcGIS.ADF.IMS | |
LabelPriority Constructor(String) | |
See Also Example Send Feedback |
ESRI.ArcGIS.ADF.IMS.Display.Renderer Namespace > LabelPriority Class > LabelPriority Constructor : LabelPriority Constructor(String) |
- axlString
Visual Basic (Usage) | ![]() |
---|---|
Dim axlString As String Dim instance As New LabelPriority(axlString) |
Parameters
- axlString
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 Basic | ![]() |
---|---|
' 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# | ![]() |
---|---|
// 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 |
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.
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