Describe Named Layer

Description

Returns a description of a named layer, including tables, label sources (named or inline), attributes, themes, and visibility constraints. The layer portion 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 the description of a named layer, the user (or the role they belong to) needs EXECUTE permission on the Named table.

HTTP GET URL Format

This format is used for HTTP GET requests:

GET http://<server>:<port>/rest/Spatial/MappingService/layers/<named layer>.{rep}

Parameters

For information about the parameter types listed below, see Request URL Data Types.

Parameter Type Required Description
rep String yes The representation to be returned. Supported representation is JSON.

Returns

Returns metadata for a named layer in the repository. 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 example returns the metadata for the layer LayerWithTableRangeTheme located in the /Samples/NamedLayers directory in the repository.

http://<server>:<port>/rest/Spatial/MappingService/layers/Samples/NamedLayers/LayerWithTableRangeTheme.json
This example shows the JSON object returned in the response.
Note: The sample named label source 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.
{
    "layerDescription": {
        "name": "/Samples/NamedLayers/LayerWithTableRangeTheme",
        "layer": {
            "type": "FeatureLayer",
            "description": "USA States With Range Theme",
            "renderable": true,
            "table": {
                "type": "NamedTable",
                "name": "/Samples/NamedTables/USA"
            },
            "themeList": {
                "theme": [
                    {
                        "type": "RangeTheme",
                        "startStyle": {
                            "type": "MapBasicAreaStyle",
                            "MapBasicPen": {
                                "width": 2,
                                "pattern": 2,
                                "color": "32768"
                            },
                            "MapBasicBrush": {
                                "pattern": 2,
                                "foregroundColor": "32768",
                                "backgroundColor": "16777215"
                            }
                        },
                        "endStyle": {
                            "type": "MapBasicAreaStyle",
                            "MapBasicPen": {
                                "width": 2,
                                "pattern": 2,
                                "color": "16765088"
                            },
                            "MapBasicBrush": {
                                "pattern": 2,
                                "foregroundColor": "16765088",
                                "backgroundColor": "16777215"
                            }
                        },
                        "allOthers": {
                            "type": "NamedStyle",
                            "name": "/Samples/NamedStyles/CompositeStyleRangeThemeAllOtherStyle"
                        },
                        "rangeThemeProperties": {
                            "rangeType": "EQUAL_COUNT",
                            "expression": "Pop_2000",
                            "numRanges": 5,
                            "roundBy": 0,
                            "spreadBy": "COLOR",
                            "spreadBySizeMethod": "SQUARE_ROOT",
                            "noEmptyRanges": true,
                            "applyStylePart": "ALL"
                        }
                    }
                ]
            },
            "namedLabelSourceRef": "/Samples/NamedLabelSources/StateNameLabelSource"
        }
    }
}