FRAMES | NO FRAMES Description | Parameters | Examples | Response
Layer
URL http://<mapservice-url>/<layerId>
Supported Operations Query Layer
Parent Resource Map Service

Description

The layer resource represents a single layer in a map of a map service published by ArcGIS Server. It provides basic information about the layer such as its name, type, parent and sub-layers, fields, min and max scales, extent, and copyright text.

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

{
"id" : <layerId>,
"name" : "<layerName>",
"type" : "<layerType>",
"geometryType" : "<geometryType>",
"copyrightText" : "<copyrightText>",
"parentLayer" : {"id" : <parentLayerId>, "name" : "<parentLayerName>"},
"subLayers" : [
{"id" : <subLayerId1>, "name" : "<subLayerName1>"},
{"id" : <subLayerId2>, "name" : "<subLayerName2>"}
],
"minScale" : <minScale>,
"maxScale" : <maxScale>,
"extent" : {
<envelope>}
,
"displayField" : "<displayFieldName>",
"fields" : [
{"name" : "<fieldName1>", "type" : "<fieldType1>", "alias" : "<fieldAlias1>"},
{"name" : "<fieldName2>", "type" : "<fieldType2>", "alias" : "<fieldAlias2>"}
]
}

JSON Response Example

{
"id" : 3,
"name" : "Large Cities (National)",
"type" : "Feature Layer",
"geometryType" : "esriGeometryPoint",
"copyrightText" : "ESRI",
"parentLayer" : {"id" : 2, "name" : "Cities (Points)"},
"subLayers" : [],
"minScale" : 7.5E7,
"maxScale" : 2.0E7,
"extent" : {
"xmin" : -158.17, "ymin" : 19.70, "xmax" : -68.78, "ymax" : 64.84,
"spatialReference" : {"wkid" : 4326}
}
,
"displayField" : "AREANAME",
"fields" : [
{"name" : "ObjectID", "type" : "esriFieldTypeOID", "alias" : "ObjectID"},
{"name" : "AREANAME", "type" : "esriFieldTypeString", "alias" : "AREANAME"},
{"name" : "POP2000", "type" : "esriFieldTypeInteger", "alias" : "POP2000"},
{"name" : "Shape", "type" : "esriFieldTypeGeometry", "alias" : "Shape"}
]
}