VALUEMAPLABELRENDERER | Examples |
<VALUEMAPLABELRENDERER | Attribute
Description Table |
labelfield ="string" lookupfield ="string" featureweight ="no_weight | med_weight | high_weight" [no_weight] howmanylabels ="one_label_per_name | one_label_per_shape | one_label_per_part" labelbufferratio ="double" labelpriorities ="0,0,0,0,0,0,0,0 - 8,8,8,8,8,8,8,8 | LE_PlaceOnTopHorizontal" [2,2,1,4,5,3,2,4] labelweight ="no_weight | med_weight | high_weight" [high_ weight] linelabelposition ="See table below for values" [PlaceAbove] rotationalangles ="string" > (m) <EXACT... /> [Or] (m) <RANGE... /> [Or] <OTHER... /> </VALUEMAPLABELRENDERER > | |
Bold: Attribute or child element is
required. (m): Child element can be used multiple times. |
Attribute | Usage | Back to Top | |||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
featureweight | 1 Prioritizes the importance of features. The feature weight determines how important the feature labeled is for the label placement algorithm. If "no_weight" is specified, then the feature has no importance and can be labeled over. If "high_weight" is specified, then the feature has high importance and cannot be labeled over. Giving importance to features increases the complexity of the labeling problem and also the processing time. | ||||||||||
howmanylabels | 2 Determines how often a feature is
labeled.
| ||||||||||
labelbufferratio | 3 Used to set a buffer around the label. When this is set, no labels overlap within the buffer range. The ratio is the fraction of the height or the width of the label rectangle (whichever is smaller) compared to the width of the buffer. A ratio of "0.0" means no buffer. A ratio of "1.0" means that the buffer is twice the size of the label (the label width equals the buffer width). A negative ratio causes the buffer to be smaller than the label. This can be used to allow labels to overlap. | ||||||||||
labelfield | 4 Field containing text for labeling
features. The field can be in the layer table or in a joined table.
| ||||||||||
labelpriorities | 5 Used to determine where to place the
label around the point. The attribute accepts different weights for each
of eight positions around the point. Each position corresponds to the
positions as shown below:
In each position, the user can prioritize the importance of that position from 0 upwards. 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. <VALUEMAPLABELRENDERER lookupfield="TYPE" labelfield="NAME" labelpriorities="1,2,3,0,1,0,0,0"> Another option is to place a label on top of points rather than around points. To do this, use "LE_PlaceOnTopHorizontal" for the label priority. <VALUEMAPLABELRENDERER lookupfield="TYPE" labelfield="NAME" labelpriorities="LE_PlaceOnTopHorizontal"> | ||||||||||
labelweight | 6 Used to prioritize the importance of labels. The label weight is usually set to "high_weight" since the labels are more important. This can be set lower if the labels are not as important as the feature. | ||||||||||
linelabelposition | 7 Determines where on the line to
place the label. The following options are available:
| ||||||||||
lookupfield | 8 Name of field used to specify ranges for RANGE or exact values for EXACT. | ||||||||||
rotationalangles | 9 The rotational angles are possible
angles that the label can be placed at, relative to the labeled point. By
default, labels are always placed horizontally. To rotate a label, a
comma-delimited list of up to eight rotational angles can be given and are
prioritized from first to last. For example, if the first priority is to
place labels at 45 degrees and the second priority is at 30 degrees, the
rotational angles attribute would look like
this: <VALUEMAPLABELRENDERER lookupfield="TYPE" labelfield="NAME" rotationalangles="45,30"> Labelpriorities always take precedence over rotationalangles. If you find that your labels are not rotating as expected, remove the labelpriorities attribute if it is present. Alternatively, you can set all the labelpriorities to "0". <VALUEMAPLABELRENDERER lookupfield="TYPE" labelfield="NAME" rotationalangles="45,30" > or <VALUEMAPLABELRENDERER lookupfield="TYPE" labelfield="NAME" labelpriorities="0,0,0,0,0,0,0,0" rotationalangles="45,30" > |
Example 1: Labels for a line layer using EXACT. | Back to Top |
<?xml version="1.0"
encoding="UTF-8"?> <ARCXML version="1.1"> <CONFIG> <ENVIRONMENT> <LOCALE country="US" language="en" variant="" /> <UIFONT color="0,0,0" name="Arial" size="12" style="regular" /> <SCREEN dpi="96" /> </ENVIRONMENT> <MAP> <PROPERTIES> <ENVELOPE minx="-178.215027" miny="18.924782" maxx="-66.969849" maxy="71.406647" name="Initial_Extent" /> <MAPUNITS units="decimal_degrees" /> </PROPERTIES> <WORKSPACES> <SHAPEWORKSPACE name="shp_ws-0" directory="<path to USA ESRIDATA>"/> </WORKSPACES> <LAYER type="featureclass" name="ROADS" visible="true" id="1"> <DATASET name="ROADS" type="line" workspace="shp_ws-0" /> <GROUPRENDERER> <VALUEMAPLABELRENDERER lookupfield="ADMN_CLASS" labelfield="ROUTE" linelabelposition="placeontop" howmanylabels="one_label_per_shape"> <EXACT value="US Highway" label="US Highway"> <SHIELDSYMBOL font="Arial" fontstyle="regular" fontsize="10" type="usroad" /> </EXACT> <EXACT value="Interstate" label="Interstate"> <SHIELDSYMBOL antialiasing="true" font="Arial" fontstyle="regular" fontsize="10" type="interstate" /> </EXACT> <OTHER> <TEXTSYMBOL font="Arial" fontstyle="regular" fontsize="10" /> </OTHER> </VALUEMAPLABELRENDERER> <SIMPLERENDERER> <SIMPLELINESYMBOL type="solid" width="2" color="27,127,27" /> </SIMPLERENDERER> </GROUPRENDERER> </LAYER> </MAP> </CONFIG> </ARCXML> |
Example 2: Labels for a point layer using different types of text symbols in RANGE. | Back to Top |
<?xml version="1.0"
encoding="UTF-8"?> <ARCXML version="1.1"> <CONFIG> <ENVIRONMENT> <LOCALE country="US" language="en" variant="" /> <UIFONT color="0,0,0" name="Arial" size="12" style="regular" /> <SCREEN dpi="96" /> </ENVIRONMENT> <MAP> <PROPERTIES> <ENVELOPE minx="-180" miny="-90" maxx="180" maxy="90" name="Initial_Extent" /> <MAPUNITS units="decimal_degrees" /> </PROPERTIES> <WORKSPACES> <SHAPEWORKSPACE name="shp_ws-0" directory="<path to WORLD ESRIDATA>"/> </WORKSPACES> <LAYER type="featureclass" name="cities" visible="true" id="1"> <DATASET name="cities" type="point" workspace="shp_ws-0" /> <GROUPRENDERER> <VALUEMAPLABELRENDERER lookupfield="POPULATION" labelfield="NAME" labelpriorities="1,0,0,0,0,0,0,0"> <RANGE lower="0.0" upper="150000.0" label="Smallest"> <TEXTSYMBOL font="Tahoma" fontstyle="regular" fontsize="10" /> </RANGE> <RANGE lower="150001.0" upper="750000.0" label="Medium"> <TEXTSYMBOL font="Arial" fontstyle="italic" fontsize="12" glowing="125,125,125" /> </RANGE> <RANGE lower="750001.0" upper="3427180.0" label="Largest"> <TEXTSYMBOL font="Times New Roman" fontstyle="bolditalic" fontsize="14" glowing="255,255,0" shadow="0,0,0" /> </RANGE> </VALUEMAPLABELRENDERER> <SIMPLERENDERER> <SIMPLEMARKERSYMBOL color="51,102,51" width="8" /> </SIMPLERENDERER> </GROUPRENDERER> </LAYER> </MAP> </CONFIG> </ARCXML> |