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

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. From 10 onward, it also provides information regarding the relationship of this layer / table with other layers / tables in the map service. A property to indicate whether the layer / table has attachments or not was also added at 10.

Support for time-aware layers / tables was added at 10. If a layer / table supports quering and exporting maps based on time, the response will include a timeInfo property which includes information such as the start time field (or the time instance field), the end time field, the track ID field, the layer's time extent and the suggested draw time interval.

Resource Hierarchy

Layer

Parameters

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

Values: html | json

Example Usage

Example 1: Get information about layer 2 in the ESRI_StateCityHighway_USA service on sampleserver1:

http://sampleserver1.arcgisonline.com/ArcGIS/rest/services/Specialty/ESRI_StateCityHighway_USA/MapServer/2

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>",
"copyrightText" : "<copyrightText>",
"parentLayer" : {"id" : <parentLayerId>, "name" : "<parentLayerName>"},
"subLayers" : [
    {"id" : <subLayerId1>, "name" : "<subLayerName1>"},
    {"id" : <subLayerId2>, "name" : "<subLayerName2>"}
],
"minScale" : <minScale>,
"maxScale" : <maxScale>,
"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>"
  }
},

//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>,
  },
  {
    "id" : <relationshipId2>,
    "name" : "<relationshipName2>",
    "relatedTableId" : <relatedTableId2>,
  }
],
//comma separated list of supported capabilities - e.g. "Map,Query,Data"
"capabilities" : "<capabilities>"
}

JSON Response Example

{
"currentVersion": 10.01, "id" : 0, "name" : "Wells", "type" : "Feature Layer", "description" : "", "definitionExpression" : "", "geometryType" : "esriGeometryPoint", "copyrightText" : "", "parentLayer" : null, "subLayers" : [], "minScale" : 0, "maxScale" : 0, "defaultVisibility" : false, "extent" : { "xmin" : -102.048629, "ymin" : 5.6843418860808E-14, "xmax" : 5.6843418860808E-14, "ymax" : 40.0020000000001, "spatialReference" : { "wkid" : 4267 } }, "hasAttachments" : false, "timeInfo" : { "startTimeField" : "COMPLETION", "endTimeField" : "PLUG_DATE", "trackIdField" : null, "timeExtent" : [ -2556057600000, 1246060800000 ], "timeReference" : null, "timeInterval" : 3, "timeIntervalUnits" : "esriTimeUnitsYears", "exportOptions" : { "useTime" : true, "timeDataCumulative" : false, "timeOffset" : null, "timeOffsetUnits" : null } }, "drawingInfo" : {"renderer" : { "type" : "simple", "symbol" : { "type" : "esriSMS", "style" : "esriSMSCircle", "color" : [ 166, 36, 0, 255 ], "size" : 4, "angle" : 0, "xoffset" : 0, "yoffset" : 0, "outline" : { "color" : [ 0, 0, 0, 255 ], "width" : 1 } }, "label" : "", "description" : "" }, "scaleSymbols" : true, "transparency" : 0, "brightness" : 0, "contrast" : 0, "labelingInfo" : null}, "displayField" : "FIELD_NAME", "fields" : [ { "name" : "OBJECTID", "type" : "esriFieldTypeOID", "alias" : "OBJECTID"}, { "name" : "Shape", "type" : "esriFieldTypeGeometry", "alias" : "Shape"}, { "name" : "KID", "type" : "esriFieldTypeDouble", "alias" : "KID"}, { "name" : "STATE_CODE", "type" : "esriFieldTypeSmallInteger", "alias" : "STATE_CODE"}, { "name" : "COUNTY_COD", "type" : "esriFieldTypeSmallInteger", "alias" : "COUNTY_COD"}, { "name" : "API_WELL_N", "type" : "esriFieldTypeInteger", "alias" : "API_WELL_N"}, { "name" : "API_WORKOV", "type" : "esriFieldTypeString", "alias" : "API_WORKOV", "length" : 4}, { "name" : "FIELD_NAME", "type" : "esriFieldTypeString", "alias" : "FIELD_NAME", "length" : 40}, { "name" : "FIELD_KID", "type" : "esriFieldTypeDouble", "alias" : "FIELD_KID"}, { "name" : "LEASE_NAME", "type" : "esriFieldTypeString", "alias" : "LEASE_NAME", "length" : 60}, { "name" : "WELL_NAME", "type" : "esriFieldTypeString", "alias" : "WELL_NAME", "length" : 40}, { "name" : "WELL_CLASS", "type" : "esriFieldTypeString", "alias" : "WELL_CLASS", "length" : 50}, { "name" : "OPERATOR_N", "type" : "esriFieldTypeString", "alias" : "OPERATOR_N", "length" : 100}, { "name" : "OPERATOR_K", "type" : "esriFieldTypeDouble", "alias" : "OPERATOR_K"}, { "name" : "LATITUDE", "type" : "esriFieldTypeDouble", "alias" : "LATITUDE"}, { "name" : "LATITUDE_L", "type" : "esriFieldTypeDouble", "alias" : "LATITUDE_L"}, { "name" : "LATITUDE_1", "type" : "esriFieldTypeDouble", "alias" : "LATITUDE_1"}, { "name" : "LATITUDE_D", "type" : "esriFieldTypeString", "alias" : "LATITUDE_D", "length" : 1}, { "name" : "LONGITUDE", "type" : "esriFieldTypeDouble", "alias" : "LONGITUDE"}, { "name" : "LONGITUDE_", "type" : "esriFieldTypeDouble", "alias" : "LONGITUDE_"}, { "name" : "LONGITUDE1", "type" : "esriFieldTypeDouble", "alias" : "LONGITUDE1"}, { "name" : "LONGITUD_1", "type" : "esriFieldTypeString", "alias" : "LONGITUD_1", "length" : 1}, { "name" : "LONGITUD_2", "type" : "esriFieldTypeString", "alias" : "LONGITUD_2", "length" : 20}, { "name" : "PRINCIPAL_", "type" : "esriFieldTypeString", "alias" : "PRINCIPAL_", "length" : 20}, { "name" : "TOWNSHIP", "type" : "esriFieldTypeSmallInteger", "alias" : "TOWNSHIP"}, { "name" : "TOWNSHIP_D", "type" : "esriFieldTypeString", "alias" : "TOWNSHIP_D", "length" : 1}, { "name" : "RANGE", "type" : "esriFieldTypeSmallInteger", "alias" : "RANGE"}, { "name" : "RANGE_DIRE", "type" : "esriFieldTypeString", "alias" : "RANGE_DIRE", "length" : 1}, { "name" : "SECTION", "type" : "esriFieldTypeSmallInteger", "alias" : "SECTION"}, { "name" : "SUBDIVISIO", "type" : "esriFieldTypeString", "alias" : "SUBDIVISIO", "length" : 2}, { "name" : "SUBDIVIS_1", "type" : "esriFieldTypeString", "alias" : "SUBDIVIS_1", "length" : 2}, { "name" : "SUBDIVIS_2", "type" : "esriFieldTypeString", "alias" : "SUBDIVIS_2", "length" : 2}, { "name" : "SUBDIVIS_3", "type" : "esriFieldTypeString", "alias" : "SUBDIVIS_3", "length" : 2}, { "name" : "SPOT", "type" : "esriFieldTypeString", "alias" : "SPOT", "length" : 2}, { "name" : "FEET_NORTH", "type" : "esriFieldTypeInteger", "alias" : "FEET_NORTH"}, { "name" : "FEET_EAST_", "type" : "esriFieldTypeInteger", "alias" : "FEET_EAST_"}, { "name" : "REFERENCE_", "type" : "esriFieldTypeString", "alias" : "REFERENCE_", "length" : 2}, { "name" : "MEETS_AND_", "type" : "esriFieldTypeString", "alias" : "MEETS_AND_", "length" : 254}, { "name" : "ELEVATION_", "type" : "esriFieldTypeString", "alias" : "ELEVATION_", "length" : 40}, { "name" : "ELEVATION", "type" : "esriFieldTypeDouble", "alias" : "ELEVATION"}, { "name" : "ROTARY_TOT", "type" : "esriFieldTypeInteger", "alias" : "ROTARY_TOT"}, { "name" : "ROTARY_T_1", "type" : "esriFieldTypeString", "alias" : "ROTARY_T_1", "length" : 60}, { "name" : "STATUS", "type" : "esriFieldTypeString", "alias" : "STATUS", "length" : 20}, { "name" : "DATA_SOURC", "type" : "esriFieldTypeString", "alias" : "DATA_SOURC", "length" : 40}, { "name" : "SPUD_DATE", "type" : "esriFieldTypeDate", "alias" : "SPUD_DATE", "length" : 8}, { "name" : "PERMIT_DAT", "type" : "esriFieldTypeDate", "alias" : "PERMIT_DAT", "length" : 8}, { "name" : "COMPLETION", "type" : "esriFieldTypeDate", "alias" : "COMPLETION", "length" : 8}, { "name" : "OLD_API_NU", "type" : "esriFieldTypeString", "alias" : "OLD_API_NU", "length" : 200}, { "name" : "OLD_LOCATI", "type" : "esriFieldTypeString", "alias" : "OLD_LOCATI", "length" : 200}, { "name" : "OLD_WELL_N", "type" : "esriFieldTypeString", "alias" : "OLD_WELL_N", "length" : 254}, { "name" : "UPDATE_INI", "type" : "esriFieldTypeString", "alias" : "UPDATE_INI", "length" : 30}, { "name" : "UPDATE_DAT", "type" : "esriFieldTypeDate", "alias" : "UPDATE_DAT", "length" : 8}, { "name" : "API_NUMBER", "type" : "esriFieldTypeString", "alias" : "API_NUMBER", "length" : 40}, { "name" : "PLUG_DATE", "type" : "esriFieldTypeDate", "alias" : "PLUG_DATE", "length" : 8}, { "name" : "SKIP_IT", "type" : "esriFieldTypeString", "alias" : "SKIP_IT", "length" : 2}, { "name" : "OLD_FOOTAG", "type" : "esriFieldTypeString", "alias" : "OLD_FOOTAG", "length" : 200}, { "name" : "OLD_QUARTE", "type" : "esriFieldTypeString", "alias" : "OLD_QUARTE", "length" : 200}, { "name" : "COMMENTS", "type" : "esriFieldTypeString", "alias" : "COMMENTS", "length" : 254}, { "name" : "ELEVATION1", "type" : "esriFieldTypeDouble", "alias" : "ELEVATION1"}, { "name" : "ELEVATIO_1", "type" : "esriFieldTypeDouble", "alias" : "ELEVATIO_1"}, { "name" : "ELEVATIO_2", "type" : "esriFieldTypeDouble", "alias" : "ELEVATIO_2"}, { "name" : "ELEVATIO_3", "type" : "esriFieldTypeDouble", "alias" : "ELEVATIO_3"}, { "name" : "TOP_CARD_C", "type" : "esriFieldTypeString", "alias" : "TOP_CARD_C", "length" : 30}, { "name" : "TOP_CARD_1", "type" : "esriFieldTypeDate", "alias" : "TOP_CARD_1", "length" : 8}, { "name" : "INITIAL_PR", "type" : "esriFieldTypeDouble", "alias" : "INITIAL_PR"}, { "name" : "INITIAL__1", "type" : "esriFieldTypeDouble", "alias" : "INITIAL__1"}, { "name" : "INITIAL__2", "type" : "esriFieldTypeDouble", "alias" : "INITIAL__2"}, { "name" : "WELL_HEADE", "type" : "esriFieldTypeDouble", "alias" : "WELL_HEADE"}, { "name" : "GAS_LEASE_", "type" : "esriFieldTypeDouble", "alias" : "GAS_LEASE_"}, { "name" : "OIL_LEASE_", "type" : "esriFieldTypeDouble", "alias" : "OIL_LEASE_"}, { "name" : "GAS_LEASE1", "type" : "esriFieldTypeString", "alias" : "GAS_LEASE1", "length" : 100}, { "name" : "OIL_LEASE1", "type" : "esriFieldTypeString", "alias" : "OIL_LEASE1", "length" : 100}, { "name" : "PRODUCING_", "type" : "esriFieldTypeString", "alias" : "PRODUCING_", "length" : 100}, { "name" : "PRODUCING1", "type" : "esriFieldTypeString", "alias" : "PRODUCING1", "length" : 100}, { "name" : "PRODUCIN_1", "type" : "esriFieldTypeDouble", "alias" : "PRODUCIN_1"}, { "name" : "PRODUCIN_2", "type" : "esriFieldTypeString", "alias" : "PRODUCIN_2", "length" : 40}, { "name" : "ROTARY_T_2", "type" : "esriFieldTypeDouble", "alias" : "ROTARY_T_2"}, { "name" : "BOTTOM_HOL", "type" : "esriFieldTypeSmallInteger", "alias" : "BOTTOM_HOL"}, { "name" : "BOTTOM_H_1", "type" : "esriFieldTypeString", "alias" : "BOTTOM_H_1", "length" : 40}, { "name" : "API_NUMB_1", "type" : "esriFieldTypeString", "alias" : "API_NUMB_1", "length" : 14}, { "name" : "WELL_TYPE", "type" : "esriFieldTypeString", "alias" : "WELL_TYPE", "length" : 20}, { "name" : "WELL_DEPTH_SEALEVEL", "type" : "esriFieldTypeInteger", "alias" : "WELL_DEPTH_SEALEVEL"} ], "relationships" : [ { "id" : 3, "name" : "Well 2 Tops", "relatedTableId" : 2}, { "id" : 2, "name" : "Wells 2 Field", "relatedTableId" : 1} ], "capabilities" : "Map,Query,Data" }