Describe Named Label Sources

Description

This operation takes a named label source or list of named label sources as input in the request and returns the description of its label sources. The label source portions of the response from this describe can be incorporated in the label layer section of a map definition, which can then be used in a REST Render Map or Render Map Legend request, for example, to help determine the visibility of its labels.

ACL Authorization Flow

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

HTTP GET URL Format

Use a GET request for a single named label source:

GET http://<server>:<port>/rest/Spatial/MappingService/labelSources/labelSourcePath.json

HTTP POST URL Format

Use a POST request for multiple named label sources:

POST http://<server>:<port>/rest/Spatial/MappingService/labelSources.json
	{
            "namedLabelSourcesList":[
		"labelSourcePath1",
		"labelSourcePath2"]
       }

Returns

Returns the JSON description of one or more named label sources.

Example - GET Request

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.
GET request that describes a single named label source:
http://<server>:<port>/rest/Spatial/MappingService/labelSources/Samples/NamedLabelSources/WorldCountriesLabelSource.json

Response:

{
  "labelSourceDescription": {
    "name": "/Samples/NamedLabelSources/WorldCountriesLabelSource",
    "labelSource": {
      "table": {
        "type": "NamedTable",
        "name": "/Samples/NamedTables/WorldcapTable"
      },
      "themeList": null,
      "labelProperties": {
        "style": {
          "type": "MapBasicTextStyle",
          "MapBasicFontStyle": {
            "type": "MapBasicFontStyle",
            "fontName": "Microsoft Sans Serif",
            "style": 0,
            "size": 12,
            "foregroundColor": "0",
            "backgroundColor": "16777215"
          }
        },
        "angle": {
          "value": 0,
          "uom": "DEGREE"
        },
        "expression": null,
        "horizontalAlignment": "CENTER",
        "verticalAlignment": "MIDDLE",
        "xOffset": null,
        "yOffset": null,
        "allowOverlap": true,
        "allowOutOfView": false,
        "allowDuplicate": "ALL",
        "recalculationType": "OUT_OF_VIEW",
        "labelRelativeOrientation": null,
        "justification": "CENTER",
        "referenceGeometry": null
      },
      "visibilityConstraintList": {
        "visibilityConstraint": [
          {
            "type": "ZoomVisibilityConstraint",
            "maxZoom": {
              "value": 6000,
              "uom": "MILE"
            },
            "minZoom": {
              "value": 0,
              "uom": "MILE"
            }
          }
        ]
      },
      "name": "World Countries",
      "renderable": true
    }
  }
}

Example - POST Request

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 file to your repository.

POST request that describes multiple named label sources:

http://<server>:<port>rest/Spatial/MappingService/labelSources.json
{
       "namedLabelSourcesList":[
               "/Samples/NamedLabelSources/WorldCountriesLabelSource",
              "/Samples/NamedLabelSources/DCCitiesLabelSource"
       ]
}

Response:

        {
          "labelSourceDescriptions": [
            {
              "name": "/Samples/NamedLabelSources/WorldCountriesLabelSource",
              "labelSource": {
                "table": {
                  "type": "NamedTable",
                  "name": "/Samples/NamedTables/WorldcapTable"
                },
                "themeList": null,
                "labelProperties": {
                  "style": {
                    "type": "MapBasicTextStyle",
                    "MapBasicFontStyle": {
                      "type": "MapBasicFontStyle",
                      "fontName": "Microsoft Sans Serif",
                      "style": 0,
                      "size": 12,
                      "foregroundColor": "0",
                      "backgroundColor": "16777215"
                    }
                  },
                  "angle": {
                    "value": 0,
                    "uom": "DEGREE"
                  },
                  "expression": null,
                  "horizontalAlignment": "CENTER",
                  "verticalAlignment": "MIDDLE",
                  "xOffset": null,
                  "yOffset": null,
                  "allowOverlap": true,
                  "allowOutOfView": false,
                  "allowDuplicate": "ALL",
                  "recalculationType": "OUT_OF_VIEW",
                  "labelRelativeOrientation": null,
                  "justification": "CENTER",
                  "referenceGeometry": null
                },
                "visibilityConstraintList": {
                  "visibilityConstraint": [
                    {
                      "type": "ZoomVisibilityConstraint",
                      "maxZoom": {
                        "value": 6000,
                        "uom": "MILE"
                      },
                      "minZoom": {
                        "value": 0,
                        "uom": "MILE"
                      }
                    }
                  ]
                },
                "name": "World Countries",
                "renderable": true
              }
            },
            {
              "name": "/Samples/NamedLabelSources/DCCitiesLabelSource",
              "labelSource": {
                "table": {
                  "type": "NamedTable",
                  "name": "/Samples/NamedTables/dcwashcities"
                },
                "themeList": null,
                "labelProperties": {
                  "style": {
                    "type": "MapBasicTextStyle",
                    "MapBasicFontStyle": {
                      "type": "MapBasicFontStyle",
                      "fontName": "Verdana",
                      "style": 0,
                      "size": 7,
                      "foregroundColor": "0",
                      "backgroundColor": "15657438"
                    }
                  },
                  "angle": null,
                  "expression": null,
                  "horizontalAlignment": "CENTER",
                  "verticalAlignment": "MIDDLE",
                  "xOffset": null,
                  "yOffset": null,
                  "allowOverlap": false,
                  "allowOutOfView": false,
                  "allowDuplicate": "INTERLAYER",
                  "recalculationType": "OUT_OF_VIEW",
                  "labelRelativeOrientation": "PARALLEL",
                  "justification": "CENTER",
                  "referenceGeometry": null
                },
                "visibilityConstraintList": {
                  "visibilityConstraint": [
                    {
                      "type": "ZoomVisibilityConstraint",
                      "maxZoom": {
                        "value": 50,
                        "uom": "MILE"
                      },
                      "minZoom": {
                        "value": 0,
                        "uom": "MILE"
                      }
                    }
                  ]
                },
                "name": "dcwash~cities",
                "renderable": true
              }
            }
          ]
        }