名前付きラベル ソースの記述

説明

この操作は、1 つ以上の名前付きラベル ソースを入力としてリクエストから受け取り、そのラベル ソースの記述を返すというものです。この記述からのレスポンスに含まれるラベル ソース部は、マップ定義のラベル レイヤ セクションに組み込むことができます。この定義は、REST Render Map や Render Map Legend などのリクエストでラベルの可視性を指定するために利用できます。

HTTP GET URL 形式

単一の名前付きラベル ソースには GET リクエストを使用します。

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

HTTP POST URL 形式

複数の名前付きラベル ソースには POST リクエストを使用します。


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

戻り値

1 つ以上の名前付きラベル ソースの JSON による記述を返します。

例 - GET リクエスト

注: この例のサンプル名前付きラベル ソースは、Spectrum™ Technology Platformのバージョン 12.0 の一部として/Samples フォルダに提供されます。11.1 バージョンについては、WebDAV を使ってサンプルを 11.1 パッチの zip ファイルまたは tar ファイルからリポジトリにコピーします。
単一の名前付きラベル ソースを記述する GET リクエスト:
http://<server>:<port>/rest/Spatial/MappingService/labelSources/Samples/NamedLabelSources/WorldCountriesLabelSource.json

レスポンス:

{
  "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
    }
  }
}

例 - POST リクエスト

注: この例のサンプル名前付きラベル ソースは、Spectrum™ Technology Platformのバージョン 12.0 の一部として/Samples フォルダに提供されます。11.1 バージョンについては、WebDAV を使ってサンプルを 11.1 パッチの zip ファイルからリポジトリにコピーします。

複数の名前付きラベル ソースを記述する POST リクエスト:


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

{
       "namedLabelSourcesList":[
               "/Samples/NamedLabelSources/WorldCountriesLabelSource",
              "/Samples/NamedLabelSources/DCCitiesLabelSource"
       ]
}

レスポンス:


        {
          "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
              }
            }
          ]
        }