labelingInfo

The labelingInfo object specifies the label definition for a layer.

Properties

Property Details
labelExpression Defines the expression for text of labels. Deprecated on FeatureLayer, Use labelExpressionInfo instead.
labelExpressionInfo Type:object
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
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.
name The name of the 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.

Example

{
  "labelingInfo": [
    {
      "labelExpressionInfo": {
        "expression": "return $feature[\"state_name\"];"
      },
      "useCodedValues": false,
      "maxScale": 0,
      "minScale": 0,
      "labelPlacement": "esriServerPointLabelPlacementAboveLeft",
      "symbol": {
        "type": "LabelSymbol3D",
        "symbolLayers": [
          {
            "size": 32,
            "type": "Text",
            "material": {
              "color": [
                255,
                255,
                0
              ]
            }
          }
        ]
      }
    }
  ]
}

Feedback on this topic?