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.

ACL Authorization Flow

To list description of layers, the user (or the role they belong to) needs EXECUTE permission on the Named table.

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}

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:

Note: The sample named label sources in this example will be provided in the /Samples folder as part of the version 12.0 release of Spectrumâ„¢ Technology Platform. For the 11.1 version, use WebDAV to copy the samples from the 11.1 patch zip or tar file to your repository.
{
  "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"
          }
        ]
      }
    }
  ]
}