Layer / Table

Description

NoteNote:

In releases earlier than 10.0, this resource represented only a layer. In 10.0 and later, it represents either a layer or table depending on whether the LayerOrTableId is that of a layer or a table.

The layer/table resource represents a single layer/table in a map of a map service published by ArcGIS Server. It provides basic information about the layer/table such as its name, type, and fields. For layers, it provides additional information about the layer such as its parent and sublayers, minimum and maximum scales, extent, and copyright text.

If a layer is authored with display expression and not a display field, displayField will be the first field used in the display expression.

supportsStatistics and supportsAdvancedQueries are dependent on the layer data source.

supportsStatistics would return false in the following scenarios:

supportsAdvancedQueries would return false in the following scenarios:

New in 10.9

New in 10.8

New in 10.7.1

New in 10.6.1

New in 10.6

New in 10.5.1

New in 10.5

New in 10.3.1

New in 10.3

New in 10.2

New in 10.1 SP1

New in 10.1

New in 10.0

Request parameters

Parameter

Details

f

The response format. The default response format is html.

Values: html | json

returnUpdates

This parameter was added at 10.1. If value is true, returns updated time extent. If the layer is not time-aware, returns an empty response.

Values: true | false

returnDomainNames

This parameter was added at 10.5.1. If the value is true, then domain information provided in the layer includes only the domain name. To get the full domain information, use the queryDomains operation in the service resource. This domain, included in the layer, can be used to link to the full domain information via the domain name. If the value is false or not set, full domain information is included in the layer as it was in past releases.

Values: true | false

advancedQueryCapablities

Example usage

Example 1: Get information about layerId3 in the Census map service:

https://sampleserver6.arcgisonline.com/arcgis/rest/services/Census/MapServer/3

Example 2: Using returnUpdates to return updated temporal information, if the layer is time enabled.

https://sampleserver6.arcgisonline.com/arcgis/rest/services/Hurricanes/MapServer/0?returnUpdates=true&f=pjson

JSON Response syntax

Below is an example of the JSON response syntax:

{
  "currentVersion": <currentVersion>, //Added at 10.0 SP1
  "id": <layerOrTableId>,
  "name": "<layerOrTableName>",
  "type": "<layerOrTableType>", //for tables, the type will be "Table"
  "description": "<description>",
  "definitionExpression": "<definitionExpression>",
  //properties specific to layers only
  "geometryType": "<geometryType>",
  "hasZ": <true|false>, //added in 10.1
  "hasM": <true|false>, //added in 10.1
  "copyrightText": "<copyrightText>",
  "parentLayer": {
    "id": <parentLayerId>,
    "name": "<parentLayerName>"
  },
  "subLayers": [
    {
      "id": <subLayerId1>,
      "name": "<subLayerName1>"
    },
    {
      "id": <subLayerId2>,
      "name": "<subLayerName2>"
    }
  ],
  "minScale": <minScale>,
  "maxScale": <maxScale>,
  "effectiveMinScale": <effectiveMinScale>,
  "effectiveMaxScale": <effectiveMaxScale>,
  "defaultVisibility": <true | false>,
  "extent": <envelope>,
  //from 10 onward - if the layer / table supports querying and exporting maps based on time
  "timeInfo": {
    "startTimeField": "<startTimeFieldName>",
    "endTimeField": "<endTimeFieldName>",
    "trackIdField": "<trackIdFieldName>",
    "timeExtent": [<startTime>, <endTime>],
    "timeReference": {
      "timeZone": "<timeZone>",
      "respectsDaylightSaving": <true | false>
    },
    "timeInterval": <timeInterval>,
    "timeIntervalUnits": "<timeIntervalUnits>",
    //the default time-related export options for this layer
    "exportOptions": {
      //If true, use the time extent specified by the time parameter
      "useTime": < true | false >,
      //If true, draw all the features from the beginning of time for that data
      "timeDataCumulative": < true | false >,
      //Time offset for this layer so that it can be overlaid on the top of a previous or future time period
      "timeOffset": <timeOffset1>,
      "timeOffsetUnits": "<esriTimeUnitsCenturies | esriTimeUnitsDays | esriTimeUnitsDecades |
                           esriTimeUnitsHours | esriTimeUnitsMilliseconds | esriTimeUnitsMinutes |
                           esriTimeUnitsMonths | esriTimeUnitsSeconds | esriTimeUnitsWeeks | esriTimeUnitsYears |
                           esriTimeUnitsUnknown>"
    }
    "hasLiveData": <true | false>,
  },
  //from 10.0 onward - for feature layers only
  "drawingInfo": {
    "renderer": <renderer>,
    "transparency": <transparency>,
    "labelingInfo": <labelingInfo>
  },
  //from 10 onward - indicates whether the layer / table has attachments or not
  "hasAttachments": <true | false>,
  //from 10 onward - indicates whether the layer / table has htmlPopups
  "htmlPopupType": "<esriServerHTMLPopupTypeNone | esriServerHTMLPopupTypeAsURL | esriServerHTMLPopupTypeAsHTMLText>",
  //layer / table field information
  "displayField": "<displayFieldName>",
  //the typeIdField is new at 10.0
  "typeIdField": "<typeIFieldName>",
  //from 10.0 fields of type (String, Date, GlobalID, GUID and XML) have an additional length property
  //from 10.0 onward the field domains are also included
  "fields": [
    {
      "name": "<fieldName1>",
      "type": "<fieldType1>",
      "alias": "<fieldAlias1>",
      "length": "<length1>",
      "domain": <domain1>
    },
    {
      "name": "<fieldName2>",
      "type": "<fieldType2>",
      "alias": "<fieldAlias2>",
      "length": "<length2>",
      "domain": <domain2>
    }
  ],
  //new at 10.0 - if the layer has sub-types, they'll be included
  "types": [
    {
      "id": <typeId1>,
      "name": "<typeName1>",
      "domains": {
        "<domainField11>": <domain11>,
        "<domainField12>": <domain12>
      }
    },
    {
      "id": <typeId2>,
      "name": "<typeName2>",
      "domains": {
        "<domainField11>": <domain21>,
        "<domainField12>": <domain22>
      }
    }
  ],
  //new at 10 - if the layer / table participates in relationships with other layers / tables
  "relationships": [
    {
      "id": <relationshipId1>,
      "name": "<relationshipName1>",
      "relatedTableId": <relatedTableId1>,
      "role": "<esriRelRoleOrigin>|<esriRelRoleDestination>";,//Added at 10.1
      "cardinality": "<esriRelCardinalityOneToOne>|<esriRelCardinalityOneToMany>|<esriRelCardinalityManyToMany>";,//Added at 10.1
      "keyField": "<keyFieldName2>",//Added at 10.1
      "composite": <true>|<false>,//Added at 10.1
      "relationshipTableId": <attributedRelationshipClassTableId>,  //Added in 10.1. Returned only for attributed relationships
      "keyFieldInRelationshipTable": "<key field in AttributedRelationshipClass table that matches keyField>" //Added in 10.1. Returned only for attributed relationships
    },
    {
      "id": <relationshipId2>,
      "name": "<relationshipName2>",
      "relatedTableId": <relatedTableId2>,
      "role": "<esriRelRoleOrigin>|<esriRelRoleDestination>";,//Added at 10.1
      "cardinality": "<esriRelCardinalityOneToOne>|<esriRelCardinalityOneToMany>|<esriRelCardinalityManyToMany>";,//Added at 10.1
      "keyField": "<keyFieldName2>",//Added at 10.1
      "composite": <true>|<false>,//Added at 10.1
      "relationshipTableId": <attributedRelationshipClassTableId>,  //Added in 10.1. Returned only for attributed relationships
      "keyFieldInRelationshipTable": "<key field in AttributedRelationshipClass table that matches keyField>" //Added in 10.1. Returned only for attributed relationships
    }
  ],
  //Added at 10.1
  "maxRecordCount": <recordCount>,
  //Added at 10.1 - if the layer / table supports modifying its renderer, data source, or join information.
  "canModifyLayer": <true | false>,
  //Added at 10.1 - if the layer / table supports statistical functions in query operation.
  "supportsStatistics": <true | false>,
  //Added at 10.1 - if the layer / table supports orderBy parameter in query operation.
  "supportsAdvancedQueries": <true | false>,
  //Added at 10.1 - if the layer has labels defined on it.
  "hasLabels": <true | false>,
  //Added at 10.1 - if the layer renders its symbols based on scale.
  "canScaleSymbols": <true | false>,
  //comma separated list of supported capabilities - e.g. "Map,Query,Data"
  "capabilities": "<capabilities>",
  //comma separated list of supported query output formats - e.g. "JSON"
  "supportedQueryFormats": "<supported query output formats>",
  //true if the layer is versioned.
  "isDataVersioned": <true | false>,
  //Added at 10.1 SP1.
  "ownershipBasedAccessControlForFeatures": {
    //Added at 10.1 SP1.
    "allowOthersToQuery": <true | false>
  },
  //Added at 10.3 - container for below properties.
  "advancedQueryCapabilities": {
    //Added at 10.2.
    "useStandardizedQueries": <true | false>,
    //Added at 10.3.1.
    "supportsStatistics": <true | false>,
    //Added at 10.3.
    "supportsOrderBy": true,
    //Added at 10.3.
    "supportsDistinct": true,
    //Added at 10.3.
    "supportsPagination": false,
    //Added at 10.3.
    "supportsTrueCurve": true
  }
}

JSON Response syntax

When returnUpdates is true:

{
  "id": <layer id>,
  "timeExtent": [
    <start time>,
    <end time>
  ],
  "fullExtent": {
    "xmin": <xmin>,
    "ymin": <ymin>,
    "xmax": <xmax>,
    "ymax": <ymax>,
    "spatialReference": <spatialReference>
  }
}

JSON Response example

{
  "currentVersion": 10.31,
  "id": 0,
  "name": "BuildingPermits",
  "type": "Feature Layer",
  "description": "",
  "geometryType": "esriGeometryPoint",
  "copyrightText": "",
  "parentLayer": null,
  "subLayers": [],
  "minScale": 0,
  "maxScale": 0,
  "drawingInfo": {
    "renderer": {
      "type": "simple",
      "symbol": {
        "type": "esriSMS",
        "style": "esriSMSCircle",
        "color": [
          135,
          99,
          0,
          255
        ],
        "size": 4,
        "angle": 0,
        "xoffset": 0,
        "yoffset": 0,
        "outline": {
          "color": [
            0,
            0,
            0,
            255
          ],
          "width": 1
        }
      },
      "label": "",
      "description": ""
    },
    "transparency": 0,
    "labelingInfo": null
  },
  "defaultVisibility": true,
  "extent": {
    "xmin": -1.366377185708964E7,
    "ymin": 5699225.41829418,
    "xmax": -1.3663618388213603E7,
    "ymax": 5699411.767458527,
    "spatialReference": {
      "wkid": 102100,
      "latestWkid": 3857
    }
  },
  "hasAttachments": false,
  "htmlPopupType": "esriServerHTMLPopupTypeNone",
  "displayField": "CITYNAME",
  "typeIdField": null,
  "fields": [
    {
      "name": "RECORD",
      "type": "esriFieldTypeDouble",
      "alias": "RECORD",
      "domain": null
    },
    {
      "name": "PERMITDATE",
      "type": "esriFieldTypeDate",
      "alias": "PERMITDATE",
      "length": 36,
      "domain": null
    },
    {
      "name": "PERMIT_NO",
      "type": "esriFieldTypeString",
      "alias": "PERMIT_NO",
      "length": 15,
      "domain": null
    },
    {
      "name": "CITYNAME",
      "type": "esriFieldTypeString",
      "alias": "CITYNAME",
      "length": 17,
      "domain": null
    },
    {
      "name": "VALUE",
      "type": "esriFieldTypeDouble",
      "alias": "VALUE",
      "domain": null
    },
    {
      "name": "SQFT",
      "type": "esriFieldTypeDouble",
      "alias": "SQFT",
      "domain": null
    },
    {
      "name": "TLID",
      "type": "esriFieldTypeString",
      "alias": "TLID",
      "length": 17,
      "domain": null
    },
    {
      "name": "SUBDIV",
      "type": "esriFieldTypeString",
      "alias": "SUBDIV",
      "length": 63,
      "domain": null
    },
    {
      "name": "LOT",
      "type": "esriFieldTypeString",
      "alias": "LOT",
      "length": 11,
      "domain": null
    },
    {
      "name": "BLOCK",
      "type": "esriFieldTypeString",
      "alias": "BLOCK",
      "length": 7,
      "domain": null
    },
    {
      "name": "WORK_DESC",
      "type": "esriFieldTypeString",
      "alias": "WORK_DESC",
      "length": 111,
      "domain": null
    },
    {
      "name": "CONST_TYPE",
      "type": "esriFieldTypeString",
      "alias": "CONST_TYPE",
      "length": 13,
      "domain": null
    },
    {
      "name": "STRUCT_TYP",
      "type": "esriFieldTypeString",
      "alias": "STRUCT_TYP",
      "length": 12,
      "domain": null
    },
    {
      "name": "NO_UNITS",
      "type": "esriFieldTypeDouble",
      "alias": "NO_UNITS",
      "domain": null
    },
    {
      "name": "ADDRESS",
      "type": "esriFieldTypeString",
      "alias": "ADDRESS",
      "length": 37,
      "domain": null
    },
    {
      "name": "X_COORD",
      "type": "esriFieldTypeDouble",
      "alias": "X_COORD",
      "domain": null
    },
    {
      "name": "Y_COORD",
      "type": "esriFieldTypeDouble",
      "alias": "Y_COORD",
      "domain": null
    },
    {
      "name": "CODE",
      "type": "esriFieldTypeString",
      "alias": "CODE",
      "length": 13,
      "domain": null
    },
    {
      "name": "RuleID",
      "type": "esriFieldTypeInteger",
      "alias": "RuleID",
      "domain": null
    },
    {
      "name": "OwnerName",
      "type": "esriFieldTypeString",
      "alias": "OwnerName",
      "length": 50,
      "domain": null
    },
    {
      "name": "OBJECTID",
      "type": "esriFieldTypeOID",
      "alias": "OBJECTID",
      "domain": null
    },
    {
      "name": "Permit_Status",
      "type": "esriFieldTypeString",
      "alias": "Permit_Status",
      "length": 10,
      "domain": null
    }
  ],
  "relationships": [
    {
      "id": 0,
      "name": "for taslot",
      "relatedTableId": 2,
      "role": "esriRelRoleDestination",
      "keyField": "TLID",
      "cardinality": "esriRelCardinalityOneToMany",
      "composite": false
    },
    {
      "id": 1,
      "name": "owns TaxLots",
      "relatedTableId": 2,
      "role": "esriRelRoleDestination",
      "keyField": "OwnerName",
      "cardinality": "esriRelCardinalityOneToMany",
      "composite": false
    }
  ],
  "canModifyLayer": false,
  "canScaleSymbols": false,
  "hasLabels": false,
  "capabilities": "Map,Query,Data",
  "maxRecordCount": 1000,
  "supportsStatistics": true,
  "supportsAdvancedQueries": true,
  "supportedQueryFormats": "JSON, geoJSON, PBF",
  "isDataVersioned": true,
  "ownershipBasedAccessControlForFeatures": {"allowOthersToQuery": true},
  "useStandardizedQueries": true,
  "advancedQueryCapabilities": {
    "useStandardizedQueries": true,
    "supportsStatistics": true,
    "supportsOrderBy": true,
    "supportsDistinct": true,
    "supportsPagination": false,
    "supportsTrueCurve": true,
    "supportsReturningQueryExtent": true,
    "supportsQueryWithDistance": true
  },
  "dateFieldsTimeReference": null
}