Describe Named Layers
Description
This operation takes a list of layers as input in the request and returns the description of those layers, including tables, label sources (named or inline), attributes, themes, and visibility constraints. The layer portions of the response from this describe can be incorporated in a map definition, which can then be used in a REST Render Map or Render Map Legend request.
HTTP POST URL Format
The following format is used for HTTP POST requests:
POST: http://<server>:<port>/rest/Spatial/MappingService/layers.json
POST DATA: {
"namedLayersList": [
"layerPath1",
"layerPath2"]
}
POST BODY: Content-Type:application/json {list of layers}
Parameters
For information about the parameter types listed below, see Request URL Data Types.
Parameter | Type | Required | Description |
---|---|---|---|
layers=<layers> | List of Strings | yes | Comma-separated list containing paths of layers that needs to be described. For example, layers=/Samples/NamedLayers/USALayer,/Samples/NamedLayers/WorldcapFeatureLayer. |
Returns
Returns the metadata of layers. Returns a full description of the label source when describing a label layer with an inline label source; returns a reference to the named label source when describing a label layer with a named label source.
Example
This request contains a list of layers as input can made with either a GET or POST format. The response includes a description of the layers in the request, in this case information is returned only for USALayer (description, renderable, table type); the other layers did not exist and return error messages.
Using a POST request:
http://<server>:<port>/rest/Spatial/MappingService/layers.json
{
"namedLayersList":[
"/Samples/NamedLayers/USALayer",
"/Samples/NamedLayers/NonExistentLayer",
"/Samples/NamedLayers/WorldLabelLayers"]
}
Response:
{
"layerDescriptions": [
{
"name": "/Samples/NamedLayers/USALayer",
"layer": {
"type": "FeatureLayer",
"description": "USA",
"renderable": true,
"table": {
"type": "NamedTable",
"name": "/Samples/NamedTables/USA"
},
"namedLabelSourceRef": "/Samples/NamedLabelSources/StateNameLabelSource"
}
},
{
"name": "/Samples/NamedLayers/NonExistentLayer",
"errorMessage": "RepositoryEx_ResourceNotFound: Resource was not found - /Samples/NamedLayers/NonExistentLayer"
},
{
"name": "/Samples/NamedLayers/WorldLabelLayers",
"layer": {
"type": "LabelLayer",
"description": "World Labels Layer",
"renderable": true,
"labelSource": [
{
"type": "NamedLabelSource",
"renderable": true,
"name": "/Samples/NamedLabelSources/WorldCountriesLabelSource"
}
]
}
}
]
}