{
  "title": "Feature Layer (ArcGISFeatureLayer)",
  "type": "object",
  "$schema": "http://json-schema.org/draft-04/schema",
  "description": "Feature layers can be created by referencing a layer from either a map service or a feature service. Use a map service if you just want to retrieve geometries and attributes from the server and symbolize them yourself. Use a feature service if you want to take advantage of symbols from the service's source map document. Also, use a feature service if you plan on doing editing with the feature layer. Feature layers honor any feature templates configured in the source map document. Feature collection objects are used to create a feature layer based on the supplied definition.",
  "properties": {
    "disablePopup": {
      "type": "boolean",
      "description": "Indicates whether to allow a client to ignore popups defined by the service item."
    },
    "id": {
      "type": "string",
      "description": "A unique identifying string for the layer."
    },
    "itemId": {
      "type": "string",
      "description": "Optional string containing the item ID of the service if it's registered on ArcGIS Online or your organization's portal."
    },
    "layerDefinition": {
      "description": "Additional properties that define drawing information and other configurations for the layer.",
      "allOf": [
        {
          "$ref": "layerDefinition_schema.json"
        },
        {
          "properties": {
            "capabilities": {},
            "definitionExpression": {},
            "drawingInfo": {},
            "elevationInfo": {},
            "featureReduction": {},
            "maxScale": {},
            "minScale": {}
          },
          "additionalProperties": false
        }
      ]
    },
    "layerType": {
      "type": "string",
      "description": "String indicating the layer type.",
      "enum": [
        "ArcGISFeatureLayer"
      ]
    },
    "listMode": {
      "type": "string",
      "description": "To show or hide layers in the layer list",
      "enum": [
        "hide",
        "show"
      ]
    },
    "opacity": {
      "type": "number",
      "description": "The degree of transparency applied to the layer on the client side, where 0 is full transparency and 1 is no transparency.",
      "minimum": 0,
      "maximum": 1,
      "default": 1
    },
    "path": {
      "type": "string",
      "description": "For offline data, a path to a geodatabase file. A URI format is used starting with `file:` followed by a file system path with a `.geodatabase` extension. A query parameter `itemId` must also be present specifying the ID of a table in the geodatabase's `GDB_ServiceItems` table. A relative path must be from the file which defines the layer. For example `file:../p20/northamerica.geodatabase?itemId=1`.",
      "pattern": "^file:.+\\.geodatabase\\?itemId=\\d+$"
    },
    "popupInfo": {
      "type": "object",
      "description": "A popupInfo object defining the content of popup windows when you click or query a feature.",
      "$ref": "popupInfo_schema.json"
    },
    "refreshInterval": {
      "type": "number",
      "description": "Refresh interval of the layer in minutes. Non-zero value indicates automatic layer refresh at the specified interval. Value of 0 indicates auto refresh is not enabled."
    },
    "screenSizePerspective": {
      "type": "boolean",
      "description": "Apply [perspective scaling](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#screenSizePerspectiveEnabled) to screen-size symbols.",
      "default": false
    },
    "showLabels": {
      "type": "boolean",
      "description": "Labels will display if this property is set to `true` and the layer also has a [labelingInfo](labelingInfo.md) property associated with it. This property can get stored in the web scene config and in the item/data.",
      "default": false
    },
    "showLegend": {
      "type": "boolean",
      "description": "Boolean value indicating whether to display the layer in the legend. Default value is `true`.",
      "default": true
    },
    "title": {
      "type": "string",
      "description": "A user-friendly string title for the layer that can be used in a table of contents."
    },
    "url": {
      "type": "string",
      "description": "The URL to the layer. If the layer is not from a web service but rather a feature collection, then the url property is omitted.",
      "format": "uri"
    },
    "visibility": {
      "type": "boolean",
      "description": "Boolean property determining whether the layer is initially visible in the web scene.",
      "default": true
    }
  },
  "required": [
    "id",
    "layerType",
    "title"
  ],
  "additionalProperties": false,
  "esriDocumentation": {
    "examples": [
      {
        "title": "featureLayer",
        "description": "Live sample web scene showing ArcGISFeatureLayer as an [operationalLayer](https://www.arcgis.com/home/webscene/viewer.html?webscene=44136259db5b42e19d2fb88e5ef0ce1c)",
        "code": {
          "operationalLayers": [
            {
              "id": "Recreation_4720",
              "layerType": "ArcGISFeatureLayer",
              "url": "http://sampleserver6.arcgisonline.com/arcgis/rest/services/Recreation/MapServer/0",
              "visibility": true,
              "opacity": 1,
              "title": "Map Service Layer",
              "popupInfo": {
                "title": "Facilities: {description}",
                "fieldInfos": [],
                "showAttachments": true,
                "mediaInfos": []
              }
            },
            {
              "id": "DamageAssessment_2445",
              "layerType": "ArcGISFeatureLayer",
              "url": "http://sampleserver6.arcgisonline.com/arcgis/rest/services/DamageAssessment/FeatureServer/0",
              "visibility": true,
              "opacity": 1,
              "title": "Feature Service",
              "itemId": "f6df665cdf3d45e094e0e2379cf90f1c"
            }
          ]
        }
      }
    ]
  }
}
