FRAMES | NO FRAMES Description | Parameters | Examples | Response
Layer / Table
URL http://<mapservice-url>/<layerOrTableId>
Supported Operations Query   Query Related Records   Generate Renderer
Parent Resource Map Service
Child Resources Feature   Image
Required Capability Map

Description

Note: Prior to 10, this resource represented only a layer. From 10 onward, it represents either a layer or a table depending on whether the layerOrTableId is that of a layer or of 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 sub-layers, min and max scales, extent, and copyright text.

New in 10.1 SP1

New in 10.1

New in 10.0

Resource Hierarchy

Layer

Parameters

Parameter Details
f Description: The response format. The default response format is html.

Values: html | json
returnUpdates //This option was added at 10.1

Description: If value is true then returns updated time extent. If the layer is not time-aware then returns an empty response.

Values: true | false

Example Usage

Example 1: Get information about layerId 3 in the Census map service on serviecsbeta2:

http://servicesbeta2.esri.com/arcgis/rest/services/Census/MapServer/3

Example 1: Getting updated time information:

http://servicesbeta2.esri.com/arcgis/rest/services/Wildfire/MapServer/2?returnUpdates=true&f=pjson

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
    "isComposite" : <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
    "isComposite" : <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
  }
],
//new at 10.1
"maxRecordCount": <recordCount>,
//new at 10.1 - if the layer / table supports modifying its renderer, data source, or join information.
"canModifyLayer": <true | false>,
//new at 10.1 - if the layer / table supports statistical functions in query operation.
"supportsStatistics": <true | false>,
//new at 10.1 - if the layer / table supports orderBy parameter in query operation.
"supportsAdvancedQueries": <true | false>,
//new at 10.1 - if the layer has labels defined on it.
"hasLabels": <true | false>,
//new 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, AMF"
"supportedQueryFormats": "<supported query output formats>",
//true if the layer is versioned.
"isDataVersioned": <true | false>,
//new at 10.1 SP1.
"ownershipBasedAccessControlForFeatures": 
{
 "allowOthersToQuery": <true | false>
}
}

JSON Response Example

{
 "currentVersion": 10.1,
 "id": 3,
 "name": "states",
 "type": "Feature Layer",
 "description": "This service presents various population statistics from Census 2000, including total population, population density, racial counts, and more. The map service presents statistics at the state, county, block group, and block point levels.\n",
 "definitionExpression": "",
 "geometryType": "esriGeometryPolygon",
 "copyrightText": "US Bureau of the Census: http://www.census.gov",
 "parentLayer": null,
 "subLayers": [],
 "minScale": 0,
 "maxScale": 0,
 "drawingInfo": {
  "renderer": {
   "type": "simple",
   "symbol": {
    "type": "esriSFS",
    "style": "esriSFSSolid",
    "color": [
     0,
     0,
     0,
     0
    ],
    "outline": {
     "type": "esriSLS",
     "style": "esriSLSSolid",
     "color": [
      0,
      0,
      0,
      255
     ],
     "width": 2
    }
   },
   "label": "",
   "description": ""
  },
  "transparency": 0,
  "labelingInfo": null
 },
 "defaultVisibility": true,
 "extent": {
  "xmin": -178.21759836267427,
  "ymin": 18.9217863446641,
  "xmax": -66.96927103622932,
  "ymax": 71.40623536706858,
  "spatialReference": {
   "wkid": 4269,
   "latestWkid": 4269
  }
 },
 "hasAttachments": false,
 "htmlPopupType": null,
 "displayField": "STATE_NAME",
 "typeIdField": null,
 "fields": [
  {
   "name": "OBJECTID",
   "type": "esriFieldTypeOID",
   "alias": "OBJECTID",
   "domain": null
  },
  {
   "name": "STATE_NAME",
   "type": "esriFieldTypeString",
   "alias": "STATE_NAME",
   "length": 25,
   "domain": null
  },
  {
   "name": "STATE_FIPS",
   "type": "esriFieldTypeString",
   "alias": "STATE_FIPS",
   "length": 2,
   "domain": null
  },
  {
   "name": "SUB_REGION",
   "type": "esriFieldTypeString",
   "alias": "SUB_REGION",
   "length": 20,
   "domain": null
  },
  {
   "name": "STATE_ABBR",
   "type": "esriFieldTypeString",
   "alias": "STATE_ABBR",
   "length": 2,
   "domain": null
  },
  {
   "name": "POP2000",
   "type": "esriFieldTypeInteger",
   "alias": "POP2000",
   "domain": null
  },
  {
   "name": "POP2007",
   "type": "esriFieldTypeInteger",
   "alias": "POP2007",
   "domain": null
  },
  {
   "name": "POP00_SQMI",
   "type": "esriFieldTypeDouble",
   "alias": "POP00_SQMI",
   "domain": null
  },
  {
   "name": "POP07_SQMI",
   "type": "esriFieldTypeDouble",
   "alias": "POP07_SQMI",
   "domain": null
  },
  {
   "name": "WHITE",
   "type": "esriFieldTypeInteger",
   "alias": "WHITE",
   "domain": null
  },
  {
   "name": "BLACK",
   "type": "esriFieldTypeInteger",
   "alias": "BLACK",
   "domain": null
  },
  {
   "name": "AMERI_ES",
   "type": "esriFieldTypeInteger",
   "alias": "AMERI_ES",
   "domain": null
  },
  {
   "name": "ASIAN",
   "type": "esriFieldTypeInteger",
   "alias": "ASIAN",
   "domain": null
  },
  {
   "name": "HAWN_PI",
   "type": "esriFieldTypeInteger",
   "alias": "HAWN_PI",
   "domain": null
  },
  {
   "name": "OTHER",
   "type": "esriFieldTypeInteger",
   "alias": "OTHER",
   "domain": null
  },
  {
   "name": "MULT_RACE",
   "type": "esriFieldTypeInteger",
   "alias": "MULT_RACE",
   "domain": null
  },
  {
   "name": "HISPANIC",
   "type": "esriFieldTypeInteger",
   "alias": "HISPANIC",
   "domain": null
  },
  {
   "name": "MALES",
   "type": "esriFieldTypeInteger",
   "alias": "MALES",
   "domain": null
  },
  {
   "name": "FEMALES",
   "type": "esriFieldTypeInteger",
   "alias": "FEMALES",
   "domain": null
  },
  {
   "name": "AGE_UNDER5",
   "type": "esriFieldTypeInteger",
   "alias": "AGE_UNDER5",
   "domain": null
  },
  {
   "name": "AGE_5_17",
   "type": "esriFieldTypeInteger",
   "alias": "AGE_5_17",
   "domain": null
  },
  {
   "name": "AGE_18_21",
   "type": "esriFieldTypeInteger",
   "alias": "AGE_18_21",
   "domain": null
  },
  {
   "name": "AGE_22_29",
   "type": "esriFieldTypeInteger",
   "alias": "AGE_22_29",
   "domain": null
  },
  {
   "name": "AGE_30_39",
   "type": "esriFieldTypeInteger",
   "alias": "AGE_30_39",
   "domain": null
  },
  {
   "name": "AGE_40_49",
   "type": "esriFieldTypeInteger",
   "alias": "AGE_40_49",
   "domain": null
  },
  {
   "name": "AGE_50_64",
   "type": "esriFieldTypeInteger",
   "alias": "AGE_50_64",
   "domain": null
  },
  {
   "name": "AGE_65_UP",
   "type": "esriFieldTypeInteger",
   "alias": "AGE_65_UP",
   "domain": null
  },
  {
   "name": "MED_AGE",
   "type": "esriFieldTypeDouble",
   "alias": "MED_AGE",
   "domain": null
  },
  {
   "name": "MED_AGE_M",
   "type": "esriFieldTypeDouble",
   "alias": "MED_AGE_M",
   "domain": null
  },
  {
   "name": "MED_AGE_F",
   "type": "esriFieldTypeDouble",
   "alias": "MED_AGE_F",
   "domain": null
  },
  {
   "name": "HOUSEHOLDS",
   "type": "esriFieldTypeInteger",
   "alias": "HOUSEHOLDS",
   "domain": null
  },
  {
   "name": "AVE_HH_SZ",
   "type": "esriFieldTypeDouble",
   "alias": "AVE_HH_SZ",
   "domain": null
  },
  {
   "name": "HSEHLD_1_M",
   "type": "esriFieldTypeInteger",
   "alias": "HSEHLD_1_M",
   "domain": null
  },
  {
   "name": "HSEHLD_1_F",
   "type": "esriFieldTypeInteger",
   "alias": "HSEHLD_1_F",
   "domain": null
  },
  {
   "name": "MARHH_CHD",
   "type": "esriFieldTypeInteger",
   "alias": "MARHH_CHD",
   "domain": null
  },
  {
   "name": "MARHH_NO_C",
   "type": "esriFieldTypeInteger",
   "alias": "MARHH_NO_C",
   "domain": null
  },
  {
   "name": "MHH_CHILD",
   "type": "esriFieldTypeInteger",
   "alias": "MHH_CHILD",
   "domain": null
  },
  {
   "name": "FHH_CHILD",
   "type": "esriFieldTypeInteger",
   "alias": "FHH_CHILD",
   "domain": null
  },
  {
   "name": "FAMILIES",
   "type": "esriFieldTypeInteger",
   "alias": "FAMILIES",
   "domain": null
  },
  {
   "name": "AVE_FAM_SZ",
   "type": "esriFieldTypeDouble",
   "alias": "AVE_FAM_SZ",
   "domain": null
  },
  {
   "name": "HSE_UNITS",
   "type": "esriFieldTypeInteger",
   "alias": "HSE_UNITS",
   "domain": null
  },
  {
   "name": "VACANT",
   "type": "esriFieldTypeInteger",
   "alias": "VACANT",
   "domain": null
  },
  {
   "name": "OWNER_OCC",
   "type": "esriFieldTypeInteger",
   "alias": "OWNER_OCC",
   "domain": null
  },
  {
   "name": "RENTER_OCC",
   "type": "esriFieldTypeInteger",
   "alias": "RENTER_OCC",
   "domain": null
  },
  {
   "name": "NO_FARMS97",
   "type": "esriFieldTypeDouble",
   "alias": "NO_FARMS97",
   "domain": null
  },
  {
   "name": "AVG_SIZE97",
   "type": "esriFieldTypeDouble",
   "alias": "AVG_SIZE97",
   "domain": null
  },
  {
   "name": "CROP_ACR97",
   "type": "esriFieldTypeDouble",
   "alias": "CROP_ACR97",
   "domain": null
  },
  {
   "name": "AVG_SALE97",
   "type": "esriFieldTypeDouble",
   "alias": "AVG_SALE97",
   "domain": null
  },
  {
   "name": "SQMI",
   "type": "esriFieldTypeInteger",
   "alias": "SQMI",
   "domain": null
  },
  {
   "name": "Shape",
   "type": "esriFieldTypeGeometry",
   "alias": "Shape",
   "domain": null
  },
  {
   "name": "Shape_Length",
   "type": "esriFieldTypeDouble",
   "alias": "Shape_Length",
   "domain": null
  },
  {
   "name": "Shape_Area",
   "type": "esriFieldTypeDouble",
   "alias": "Shape_Area",
   "domain": null
  }
 ],
 "relationships": [],
 "canModifyLayer": true,
 "canScaleSymbols": false,
 "hasLabels": false,
 "capabilities": "Map,Query,Data",
 "maxRecordCount": 1000,
 "supportsStatistics": true,
 "supportsAdvancedQueries": true,
 "supportedQueryFormats": "JSON, AMF",
 "ownershipBasedAccessControlForFeatures": 
 {
  "allowOthersToQuery": true;
 }
}

JSON Response Syntax (when returnUpdates is true)

{
 "id": <layer id>,
 "timeExtent": [
  <start time>,
  <end time>
 ]
}