Layer source objects

Overview

This topic discusses the JSON representation of layer source objects.

The following objects are discussed:

  • Dynamic map layer
  • Dynamic data layer
  • Dynamic workspace layer

Dynamic map layer

A dynamic map layer refers to a layer in the current map service. If supported, use gdbVersion to specify an alternate geodatabase version.

Use dark colors for code blocksCopy
1
2
3
4
5
{
  "type": "mapLayer", //required
  "mapLayerId": <layerId>, //required
  "gdbVersion": "<version name>"
}

Dynamic data layer

A dynamic data layer is an on-the-fly layer created off of data from a registered workspace. The following data sources are supported:

Use dark colors for code blocksCopy
1
2
3
4
5
6
7
8
{
  "type": "dataLayer", //required
  "dataSource": <dataSource>, //required
  "fields": [
    {"name":"<fieldName1>","alias":"<fieldAlias1>"},
    {"name":"<fieldName2>","alias":"<fieldAlias2>"}
  ]
}

Dynamic workspace layer

A dynamic workspace layer refers to a pre-authored Layer File (.lyrx) created from ArcGIS Pro. These files reside in a registered folder. It allows you to dynamically use a pre-authored layer, with an advanced renderer and cartographically enriched symbols that are not supported by map service's REST API specifications, to a map service operation on a per request basis. There must be only one layer in a Layer File. For example, you cannot have a group layer or any other composite layer. The source of the layer inside a Layer File cannot be a map service, feature service, or WMS service.

Use dark colors for code blocksCopy
1
2
3
4
5
{
  "type": "workspaceLayer", //required
  "workspaceId": <registered workspace id>>, //required
  "layerId": "<lyrx file name with extension>" //required
}

Your browser is no longer supported. Please upgrade your browser for the best experience. See our browser deprecation post for more details.