labelingInfo

The labelingInfo object specifies the label definition for a layer.

Properties

Property Details
allowOverrun Specifies whether or not a label can overrun the geometry feature being labeled. Only applicable to labels for lines or polygons.
deconflictionStrategy Specifies the approach to use for deconflicting labels with this class. The option 'none' allows overlapping labels, the option 'static' treats placement as fixed positions and will not move a label to allow other labels to be places, and the option 'dynamic' allows for label movement from the specified position to optimize the number of placed labels.
If property is present, must be one of the following values:
  • none
  • static
  • dynamic
fieldInfos An array of objects representing field information to label.
See fieldInfos properties table.
labelExpression This read-only web map property allows formatting of labels. Use labelExpressionInfo instead.
labelExpressionInfo This object allows label text to be read similar to that of the popupInfo's description property.
labelPlacement This string property specifies the label placement with respect to that of its feature. A list of label placement values categorized by feature geometry types.
If property is present, must be one of the following values:
  • esriServerPointLabelPlacementAboveCenter
  • esriServerPointLabelPlacementBelowCenter
  • esriServerPointLabelPlacementCenterCenter
  • esriServerPointLabelPlacementAboveLeft
  • esriServerPointLabelPlacementBelowLeft
  • esriServerPointLabelPlacementCenterLeft
  • esriServerPointLabelPlacementAboveRight
  • esriServerPointLabelPlacementBelowRight
  • esriServerPointLabelPlacementCenterRight
  • esriServerLinePlacementAboveAfter
  • esriServerLinePlacementAboveStart
  • esriServerLinePlacementBelowAfter
  • esriServerLinePlacementBelowStart
  • esriServerLinePlacementCenterAfter
  • esriServerLinePlacementCenterStart
  • esriServerLinePlacementAboveAlong
  • esriServerLinePlacementAboveEnd
  • esriServerLinePlacementBelowAlong
  • esriServerLinePlacementBelowEnd
  • esriServerLinePlacementCenterAlong
  • esriServerLinePlacementCenterEnd
  • esriServerLinePlacementAboveBefore
  • esriServerLinePlacementBelowBefore
  • esriServerLinePlacementCenterBefore
  • esriServerPolygonPlacementAlwaysHorizontal
lineConnection Specifies the approach to use for connecting line labels with this class. The option 'none' specifies that line connection should not be performed. The option 'minimizeLabels' connects lines through intersections while 'unambiguousLabels' allows for labels on sides of intersections to clarify ambiguity with label and feature relationships.
If property is present, must be one of the following values:
  • none
  • unambiguousLabels
  • minimizeLabels
maxScale Represents the maximum scale at which the layer definition will be applied.
minScale Represents the minimum scale at which the layer definition will be applied.
multiPart Specifies the approach to use for labeling parts and segments of geometries.
If property is present, must be one of the following values:
  • labelPerSegment
  • labelPerPart
  • labelPerFeature
  • labelLargest
name The name of the label class.
priority The priority of the label class relative to other label classes. Numbers are positive with 0 being the most important and higher numbers being less important.
removeDuplicates Specifies whether or not to remove duplicates and if removing duplicate labels whether or not to do it within just this label class, within all labels of that feature type (e.g. point layers) or across all layers. The removeDuplicatesDistance is used when a value other than none is set.
If property is present, must be one of the following values:
  • none
  • labelClass
  • featureType
  • all
removeDuplicatesDistance The screen distance in points to remove duplicates within. The value 0 is a special value and indicates to remove duplicates for the entire extent.
repeatLabel A boolean value indicating whether or not to repeat the label along the feature. If true, the label will be repeated according to the repeatLabelDistance.
repeatLabelDistance The repeat label distance used when repeatLabel is true. It represents a screen distance in points.
stackAlignment This string property indicates whether or not to derive stacking from the text symbol or have dynamic stacking based on the relative position of the label to the feature.
If property is present, must be one of the following values:
  • textSymbol
  • dynamic
stackLabel Boolean value indicating whether or not to stack labels for this label class.
symbol The text symbol used to label.
useCodedValues Boolean value indicating whether to display the coded values for the specified field name(s).
where String template used to determine which features to label.

fieldInfos properties

Property Details
fieldName A string containing the field name as defined by the service. Anywhere that a fieldname is referenced as {field-name} in popupInfo, an Arcade expression can also be referenced as{expression/}`.
format A format object used with numerical or date fields to provide more detail about how the value should be displayed in a web map popup window.

Example

{
  "labelingInfo": [
    {
      "labelExpression": "[description]",
      "labelExpressionInfo": {
        "value": "{description}"
      },
      "fieldInfos": [
        {
          "fieldName": "ACRES",
          "format": {
            "places": 2,
            "digitSeparator": true
          }
        }
      ],
      "useCodedValues": false,
      "maxScale": 0,
      "minScale": 0,
      "labelPlacement": "esriServerPointLabelPlacementAboveLeft",
      "symbol": {
        "color": [
          51,
          51,
          51,
          255
        ],
        "type": "esriTS",
        "haloSize": 0,
        "horizontalAlignment": "center",
        "rightToLeft": false,
        "angle": 0,
        "xoffset": 0,
        "yoffset": 0,
        "text": "",
        "rotated": false,
        "kerning": true,
        "font": {
          "size": 9.75,
          "style": "normal",
          "decoration": "none",
          "weight": "bold",
          "family": "Arial"
        }
      }
    }
  ]
}

Feedback on this topic?