FRAMES | NO FRAMES Description
Export Web Map Specification

Description

A web map is made of 5 top level objects:

{
  "mapOptions":{ },
  "operationalLayers": [ ],
  "baseMap": [ ],
  "exportOptions": { },
  "layoutOptions": { }
}

mapOptions

mapOptions is a required object that defines map display properties.

Syntax Example
{
  "extent":
  {
    "xmin": <xmin>,
    "ymin": <ymin>,
    "xmax": <xmax>,
    "ymax": <ymax>,
    "spatialReference": <spatialReference>
  },
  "scale": <mapScale>,
  "rotation": <mapRotation>,
  "spatialReference": <spatialReference>
  "time": [ <timeInstant> | <startTime>,<endTime> ]
}
{
  "extent":
  {
    "xmin": -12933906.537,
    "ymin": 3993856.886,
    "xmax": -12933371.998,
    "ymax": 3994375.189,
    "spatialReference":
    {
      "wkid": 102100
    }
  },
  "scale": 1234.5,
  "rotation": -45,
  "spatialReference":
  {
    "wkid": 102100
  },
  "time": [1199145600000, 1230768000000]
}

Description

extent: A required property, which defines the extent of the map. The spatial reference of the extent object is optional; when it is not provided, it is assumed to be in the map's spatial reference. When the aspect ratio of the map extent is different than the size of the map on the output page or the exportOptions: outputSize, you may notice more features on the output map.

scale (optional): The map scale at which you want your map be exported. This property is optional, but recommended for getting expected results. The scale property is especially useful when map services in this web map have scale-dependent layers or reference scales set. Since the map that you are viewing on the web app may be smaller than the size of output map (for example 8.5 in x 11 in or A4 size), the scale of the output map will be different and you could see differences in features and/or symbols in the web application as compared with the output map. When scale is used, it takes precedence over the extent; but the output map is drawn at the requested scale centered on the center of the extent.

rotation (optional): This represents the number of degrees by which the data frame will be rotated, measured counterclockwise from the north. To rotate clockwise, use a negative value.

spatialReference (optional): The spatial reference of the map. The order of preference when spatialReference is missing is as follows:

  • mapOptions.extent.SpatialReference
  • baseMap.baseMapLayers.SpatialReference
  • map template spatial reference

time (optional): If there is time-aware layer and you want it to be drawn at a specified time, you need to specify this property. This order list can have one or two elements. Add two elements (startTime followed by endTime) to represent a time extent, or provide only one time element to represent a time instant. Time values are always in UTC (time zone).

opertionalLayers

The operationalLayers list contains all the operational layers to be displayed in the map. The order of the array defines the order of the layers in the map. The type of each layer is defined by the URL resource response. If the resource cannot be determined from the URL, then the type property defines the layer type. For example, wms layer requires that you specify type: "wms".

There are some properties common to all types of operational layers, while others are specific to each type of operational layer.

Notes:

Syntax Example
[
  //ArcGIS MapService Layer
  {
    "id": "<webmapOperationalLayerId1>",
    "url": "<url1>,
    "token": "<tokenString1>,
    "title": "<title1>",
    "opacity": <opacity1>,
    "visibility": <true | false>,
    "minScale": <minScale1>,
    "maxScale": <maxScale1>,
    "visibleLayers": [
      <layerId1>, <layerId2>	
    ],
    "layers": [
      {
        "id": <sub layer id 1>,
        "layerDefinition": {
          "definitionExpression": "<definition expression>",
          "layerTimeOptions": {
            "useTime": <true | false>,
            "timeDataCumulative": <true | false>,
            "timeOffset": <time offset value>,
            "timeOffsetUnits": <time offset units>
          },
          "drawingInfo": {
            "renderer": <renderer>,
            "transparency": <transparency>,
            "scaleSymbols": <true | false >,
            "showLabels": <true | false >,
            "labelingInfo": <labeling info>
          },
          "source": <layerSource>
        }
      }
    ],
    "gdbVersion": "<geodatabase version name>"
  },
  //ArcGIS Feature Layer
  {
    "id": "<webmapOperationalLayerId1>",
    "url": "<url1>,
    "token": "<tokenString1>,
    "title": "<title1>",
    "opacity": <opacity1>,
    "visibility": <true | false>,
    "minScale": <minScale1>,
    "maxScale": <maxScale1>,
    "timeInfo": {
      "trackIdField": "<trackId field name>"
    },
    "layerDefinition": {
      "drawingInfo": {
        "renderer": <renderer>,
        //latestObservationRenderer,trackLinesRenderer, 
        and observationRenderer are needed for tracking renderer.
        "latestObservationRenderer": <renderer>,
        "trackLinesRenderer": <renderer>,
        //Use rampAger
        "observationAger": {
          "colorRange": [<start color>, <end color>],
          "alphaRange": [<start alpha>, <end alpha>],
          "sizeRange": [<start size>, <end size>]
        }//OR classBreaksAger
        "observationAger": {
          "timeUnits": "<esriTimeUnits>",
          "agerClassBreakInfos": [
            {
              "newestAge": <age1>,
              "color": <color1>,
              "alpha": <alpha1>,
              "size": <size1>
            },
            {
              "newestAge": <age2>,
              "color": <color2>,
              "alpha": <alpha2>,
              "size": <size2>
            }
          ]
        }
      },
      "definitionExpression": "<definitionExpression>",
      "objectIds": [
        <OID1>,
        <OID2>
      ],
      "geometry": <geometry>,
      "geometryType": "<esriGeometryPoint | esriGeometryMultipoint | 
                              esriGeometryPolyline | esriGeometryPolygon | 
                              esriGeometryEnvelope>",
      "spatialRel": "<esriSpatialRelIntersects | esriSpatialRelContains | 
                              esriSpatialRelCrosses | esriSpatialRelEnvelopeIntersects | 
                              esriSpatialRelIndexIntersects | esriSpatialRelOverlaps | 
                              esriSpatialRelTouches | esriSpatialRelWithin | 
                              esriSpatialRelRelation>",
      "relationParam": "<relationParam>",
      "gdbVersion": "<geodatabase version name>",
      "source": <layerSource>
    },
    "selectionObjectIds": [
      <OID1>,
      <OID2>
    ],
    "selectionSymbol": <symbol>
  },
  //ArcGIS ImageService Layer
  {
    "id": "<webmapOperationalLayer_imageService>",
    "url": "<url1>,
    "token": "<tokenString1>,
    "title": "<title1>",
    "opacity": <opacity1>,
    "visibility": <true | false>,
    "minScale": <minScale1>,
    "maxScale": <maxScale1>,
    "noData": <no data value>,
    "format": "<jpgpng | png | png8 | png24 | jpg | bmp | gif | tiff>",
    "interpolation": "<RSP_BilinearInterpolation | RSP_CubicConvolution | 
                            RSP_Majority | RSP_NearestNeighbor>",
    "compressionQuality": <compression quality>,
    "bandIds": [
      <bandId1>,
      <bandId2>
    ],
    "mosaicRule": "<mosaic rule 1>",
    "renderingRule": "<rendering rule 1>"
  },
  //WMS Layer
  {
    "id": "<webmapOperationalLayer_wms>",
    "url": "<url1>,
    "token": "<tokenString1>,
    "title": "<title1>",
    "opacity": <opacity1>,
    "visibility": <true | false>,
    "minScale": <minScale1>,
    "maxScale": <maxScale1>,
    "type": "wms",
    "version": "<wms version>",
    "format": "<jpg | png8 | png24 | png32>",
    "transparentBackground": <true | false>,
    "layers": [
      {"name": "<layer 1>"},
      {"name": "<layer 2>"}
    ],
    "visibleLayers": [
      "<layer 1>",
      "<layer 2>"
    ],
    "styles": [
      "<style 1>",
      "<style 2>"
    ]
  },
  //Client side image
  {
    "id": "<webmapOperationalLayerId1>",
    "url": "<url1>,
    "token": "<tokenString1>,
    "title": "<title1>",
    "opacity": <opacity1>,
    "visibility": <true | false>,
    "minScale": <minScale1>,
    "maxScale": <maxScale1>,
    "type": "image",
    "extent": {
      "xmin": <xmin>,
      "ymin": <ymin>,
      "xmax": <xmax>,
      "ymax": <ymax>,
      "spatialReference": <spatialReference>
    },
    "url": <image url>,
    "imageData": "<base64 encoded image data>"
  },
  //Client side graphics
  {
    "id": "<webmapOperationalLayerId1>",
    "title": "<title1>",
    "featureCollection": {
      "layers": [
        {
          "layerDefinition": {
            "name": "<layer name>",
            "geometryType": "<esriGeometryPoint | esriGeometryMultipoint | 
                                  esriGeometryPolyline | esriGeometryPolygon | 
                                  esriGeometryEnvelope>",
            "drawingInfo": {
              "renderer": <renderer>
            },
            "objectIdField": "<objectId field name>",
            "fields": [
              {
                "name": "<field name1>",
                "type": "<esriFieldType>",
                "alias": "<field alias name1>"
              },
              {
                "name": "<field name2>",
                "type": "<esriFieldType>",
                "alias": "<field alias name2>"
              }
            ]
          },
          "featureSet": {
            "features": [
              {
                "geometry": <geometry>,
                "attributes": [
                  "<field1>": "<field name1>",
                  "<field2>": "<field name2>",
                ]
              }
            ],
            "symbol": <symbol>
          }
        }		
      ]
    }
  },
  //Geoprocessing Result Layer
  {
    "id": "<webmapOperationalLayerId1>",
    "url": "<url1>,
    "token": "<tokenString1>,
    "title": "<title1>",
    "opacity": <opacity1>,
    "visibility": <true | false>,
    "minScale": <minScale1>,
    "maxScale": <maxScale1>
  },
  //CSV by reference
  {
    "id": "<webmapOperationalLayerId1>",
    "url": "<url1>,
    "token": "<tokenString1>,
    "title": "<title1>",
    "opacity": <opacity1>,
    "visibility": <true | false>,
    "minScale": <minScale1>,
    "maxScale": <maxScale1>,
    "type": "CSV",
    "layerDefinition": {
      "drawingInfo": {
        "renderer": <renderer>
      }
    },
    "locationInfo": {
      "latitudeFieldName": "<latitude field name>",
      "longitudeFieldName": "<longitude field name>"
    }	
  }
]
[
  //ArcGIS MapService Layer
  {
    "id": "mapServiceLayer1",
    "url": "http://myServer/arcgis/rest/services/myService/MapServer",
    "title": "ArcGIS MapService Layer",
    "opacity": 1,
    "visibility": true,
    "minScale": 20000,
    "maxScale": null,
    "visibleLayers": [0,3],
    "layers": [
      {
        "id": <sub layer id 1>,
        "layerDefinition": {
          "definitionExpression": "<definition expression>",
          "layerTimeOptions": {LAYER TIME OPTIONS};
          "drawingInfo": {
            "renderer": <renderer>
		  },
          "source": <layerSource>
        }
      }
    ]
  },
  //ArcGIS Feature Layer
  {
    "url": "http://servicesbeta.esri.com/ArcGIS/rest/services/Hydrography/Watershed173811/FeatureServer/1",
    "title": "Watershed",
    "opacity": 1,
    "layerDefinition": 
    {
        "drawingInfo": 
        {
                "renderer": <renderer>
        },
        "definitionExpression": "Type = 1",
        "objectIds": [
            534,
            434
        ]
    },
    "selectionObjectIds": [
        434
    ],
    "selectionSymbol": <symbol>      
  },
  //ArcGIS ImageService Layer
  {
    "url": "http://ais3/ArcGIS/rest/services/QB16/ImageServer",
    "title": "Satellite image from 1990",
    "opacity": 0.8,
    "bandIds": [0,1,2]
  },
  //WMS Layer
  {
    "id": "wmsLayer1",
    "url": "http://myServer/arcgis/rest/services/myService/MapServer/WMSServer",
    "title": "WMS Service",
    "opacity": 0.7,
    "visibility": true,
    "type": "wms",
    "version": "1.3.0",
    "format": "jpg",
    "layers": [
      {"name": "0"},
      {"name": "3"}
    ],
    "styles": null,
  },
  //Client side image
  {
    "type": "image",
    "title": "heat map",
    "opacity": 0.75,
    "extent": 
    {
        "xmin": -12933906.537,
        "ymin": 3993856.886,
        "xmax": -12933371.998,
        "ymax": 3994375.189,
        "spatialReference":
        {
          "wkid": 102100
        }
    },
    "url": "http://myMachine/anImage.png"
  },
  //Geoprocessing Result Layer
  {
    "url": "http://myMachine:6080/arcgis/rest/services/Buffer/MapServer/jobs/j9aa6c36d59f44829a0daeadb2d0ff87b",
    "title": "Geoprocessing Result"
  },
  //CSV by reference
  {
    "id": "Earthquakes",
    "url": "http://servicesbeta.esri.com/demos/exp/data/earthquakes.csv,
    "title": "Earthquakes",
    "opacity": 1,
    "visibility": true,
    "type": "CSV",
    "layerDefinition": {
      "drawingInfo": {
        "renderer": {
          "type": "simple",
          "symbol": {
            "height": 15,
            "type": "esriPMS",
            "url": "http://static.arcgis.com/images/Symbols/Basic/RedSphere.png",
            "width": 15
          },
          "transparency": 0
        }
      }
    },
    "locationInfo": {
      "latitudeFieldName": "lat",
      "longitudeFieldName": "lon"
    }	
  }
]
Description

id (optional) : A string uniquely identifying an operational layer. This is mostly needed for legends.

url (required): The end point of a service. It is not needed for featuresCollection.

token (optional): A token to access a secured service.

title (optional) : Name of an operational layer. If true shows up on the legend, should the legend on the page layout support that.

visibility (optional) : Default value is true.

opacity (optional) : Value ranges from 0 to 1 (default). 1 means completely opaque, while 0 means fully transparent.

minScale (optional) : Layer does not draw when zoomed out beyond this scale.

maxScale (optional) : Layer does not draw when zoomed in beyond this scale.

Properties specific to map service layers:

  • visibleLayers (optional): Array of sublayer IDs that should be made visible within the map service layer. If this is omitted, the operational layer is drawn with the default visible states of each sublayer. You do not need to specify groupLayers Id.
    Note: If the map service supports dynamicLayers then layers takes precedence over visibleLayers. For non dynamicLayers enabled map services, only layerDefinition in the layers property is supported.
  • layers (optional): List of layers to be exported. In case of dynamicLayers enabled map services, all the layers specified in layers array are exported, while visibleLayers is ignored.
    • id (optional): Map service layer id.
    • layerDefinition (optional): Use layerDefinition to control the features that are displayed on the map.
      • definitionExpression (optional): Specify a where clause to filter features in this layer.
      • layerTimeOptions (optional): Specify temporal properties to filter features.
    • drawingInfo (optional): Use this to override the sublayer's drawing settings, for example the layer's renderer.
      Note: This property is only supported for dynamicLayers enabled map services.
      • renderer (optional): When specified, this overrides the sublayer's original renderer.
      • transparency (optional): Makes the layer transparency by the specified value. Allowable value range is 0 - 100, where 0 is opaque and 100 is fully transparent.
      • scaleSymbols (optional): Scales the symbols based on map scale, if the map service layer canScaleSymbols property is true.
      • showLabels (optional): Displays labels on the layers.
      • labelingInfo (optional): Define how the labels are displayed on the map.
    • source (optional): Represents the source of a layer that gets added to the map service dynamically per request.
  • gdbVersion (optional): Specify this if you want to see features drwn from a different geodatabase version.

Properties specific to feature layers:

  • url (required): url should end with dynamicLayer if the featureLayer is a dynamicLayer based off of a dynamicLayers enabled mapservice.
  • timeInfo:
    • trackIdField: The field that uniquely represents a given object or objects being observed. If this field is null or missing then only the latest observation is drawn using the latestObservationRenderer.
  • drawingInfo (optional): Specifies the renderer for this layer.
    Note: Feature layers do not support transparency, labelingInfo.
    • To render using temporal renderer, specify latestObservationRenderer, trackLinesRenderer, and observationAger properties apart from renderer.
    • observationAger (optional): Temporal renderer supports two types of observationalAger - rampAger and classBreaksAger. For any given request a layer can contain either a rampAger or a classBreaksAger, but not both.
  • definitionExpression (optional): A SQL statement that restricts which features will be drawn.
  • objectIds (optional): Restricts which features are drawn, based on object IDs.
  • geometry (optional): Restricts features to be drawn by a geometry.
  • geometryType (optional): This is required when a geometry is specified.
  • spatialRel (optional): The spatial relationship to be applied on the input geometry while performing the query.
  • relationParam (optional): The spatial relate function that can be applied while performing the query. An example for this spatial relate function is "FFFTTT***"
  • selectionObjectIds (optional): Highlights the features with the given object IDs with the provided symbol. selectionSymbol must be set.
  • selectionSymbol (optional): Features are highlighted with this symbol. This is required when selectionObjectIds is specified.
  • gdbVersion (optional): Specify a geodatabase version name if you use a version other than the one referred to by the map or feature service.
  • source (optional): This is only required when a featureLayer is a dynamicLayer based off of a dynamicLayers enabled mapservice.

Properties specific to WMS service layers:

  • type (required): For WMS layers, this must be specified as "wms".
  • format (optional): The requested image format from the server.
  • transparentBackgound (optional): When true, the background becomes transparent provided that the requested image format supports a transparent color (JPEG is an example of an image format that does not support a transparent color). The default value is false.
  • visibleLayers: Array of sublayer names that should be made visible within the wms service layer. The order is important too; the order must conform to the requirements of the WMS service. When not provided, all layers of the WMS service will be made visible.
  • layers (optional): Array of sublayer names to add to the map.
  • styles (optional): Use this to override a sublayer's default drawing style. When it is specified, make sure the number and order of styles match the visibleLayers array. When it is not desired to change the style for one particular sublayer, you can pass in an empty string, for example: "styles" : ["highways","","population"]
  • version (optional): the WMS version that you want to connect to. The default is the latest version supported by the given WMS service.

Properties specific to client-side image layers:

  • type (required): For this kind of layer, the type must be "image".
  • extent (required): The minimum bounding box that the image fits in.
  • url (optional): URL to an image that you would like to draw. This is only required when imageData is not passed in.
  • imageData (optional): The image encoded as base64. This is required when the url property is not passed in.

Properties specific to client-side graphic layers:
  • layers (required): Collection of layers. A layer has two properties - layerDefinition and featureSet.
  • layerDefinition (required): Contains properties that define a layer - name, geometryType, drawingInfo, objectIdField, and fields.
  • name (optional): Name of the layer.
  • geometryType (required): For text layer, the geometryType must be esriGeometryPoint.
  • drawingInfo (optional): If drawingInfo is missing then graphics are symbolized using symbol.
  • objectIdField (optional): Name of the field that contains object ids.
  • fields (optional): Collection of fields.
  • featureSet (required): Feature container.
  • features (required): Collection of features.
  • geometry (required): Geometry that defines the feature or graphic.
  • attributes (optional): Collection of feature attributes.
  • symbol (optional): If specified this symbol overrides the one defined in renderer.

Adding Geoprocessing result:
There are two ways a geoprocessing result can be included,

  1. When a geoprocessing result comes back as a FeatureSet and is drawn as graphics on the client side, send the result as a FeatureCollection,
  2. When the result is drawn by a job's result map service, add a new map service layer in operationaLayers and set the url property to point to the endpoint of the result. For example:
    • GP result off 10.1 server: http://{myMachine}/arcgis/rest/services/{GPJobMapServiceName}/MapServer/jobs/{job_id}
    • GP result off pre-10.1 server: http://{myMachine}/arcgis/rest/services/{GPServiceName}/GPServer/{GPTaskName}/jobs/{job_id}/results/{out_param_name}

baseMap

The map contains one baseMap, which has title and baseMapLayers that is an ordered list of baseMapLayer. Each baseMapLayer must be in the same spatial reference and tiling scheme. When there is a baseMap, it defines the map's spatial reference.

baseMapLayers can be comprised of one or more baseMapLayer, and you can mix-and-match these.

Note: The order of a baseMapLayer inside baseMapLayers array defines the layer drawing order. The first baseMapLayer draws below the second baseMapLayer and so on, with the last baseMapLayer drawing on top of all other baseMapLayers.

Syntax Example
{
  "title": "<title>",
  "baseMapLayers":
  [
    //ArcGIS Tiled MapService Layer
    {
      "id": "<id1>",
      "url": "<url1>",
      "opacity": <opacity1>
    },
    //BingMap Layer
    {
      "id": "<id2>",
      "type": "<BingMapsRoad | BingMapsAerial | BingMapsHybrid>",
      "culture": "<Bing maps supported culture>",
      "key": "<Bing key>",
      "opacity": <opacity2>
    },
    //OpenStreetMap Layer
    {
      "id": "<id3>",
      "type": "OpenStreetMap",
      "url": "<url2>",
      "credits": "<credits / copyright information>",
      "opacity": <opacity3>
    },
    //WMTS Layer
    {
      "id": "<id4>",
      "type": "wmts",
      "url": "<url3>",
      "layer": "<layerName>",
      "style": "<style1>",
      "format": "<imageFormat>",
      "tileMatrixSet": "<tileMatrixSet1>",
      "opacity": <opacity4>
    }
  ]
}
{
  "title": "Shared Imagery Basemap",
  "baseMapLayers":
  [
    //ArcGIS Tiled MapService Layer
    {
      "url" : "http://myServer/arcgis/rest/services/myService1/MapServer",
      "opacity" : 1;
    },
    //BingMap Layer
    {
      "id" : "bing1",
      "type" : "BingMapsRoad",
      "culture" : "fr-ca";
    },
    //OpenStreetMap Layer
    {
      "type" : "OpenStreetMap",
      "url": "http://a.tah.openstreetmap.org/Tiles/tile"
    },
    //WMTS Layer
    {
      "type" : "<wmts>",
      "url" : "http://myServer/arcgis/rest/services/myService2/MapServer/WMTS",
    }
  ]
}
Description

id (optional): A string uniquely identifying a baseMap layer.

opacity (optional): Set a transparency on the layer. Range of values: 0 - 1, where 0 is transparent and 1 is opaque.

exportOptions

exportOptions defines settings for the output map.

Syntax Example
{
  "dpi": <dpi>,
  "outputSize": [<width>, <height>]
}
{
  "dpi": 300,
  "outputSize": [500,500]
}
Description

dpi (optional): The resolution in dots per inch. The default is 96 dpi.

outputSize (optional): Size of the map in pixels. The size must be defined when an empty string or MAP_ONLY (without quotes) is passed in as a value to the Layout_Template (Export Web Map task) parameter. If Layout_Template is neither MAP_ONLY nor empty string, Layout_Template takes precedence over outputSize.

layoutOptions

layoutOptions defines settings for different available page layout elements, and is only needed when an available layout_template is chosen. Page layout elements include title, copyright text, scale bar, author name, and custom text elements.

This option replaces properties of existing elements only. If an element does not exist in the layout template, the related properties get ignored. For example, if a layout template does not have a copyright text element, layoutOptions cannot add any new copyright text element.

All the properties of this object are optional. When a value of a property is specified, the value of the corresponding page layout element is replaced; otherwise, the existing element is left untouched.

Syntax Example
{
  "titleText": "<title>",
  "authorText": "<authorName>",
  "copyrightText": "<copyright>",
  "scaleBarOptions":
  {
    "metricUnit": "<meters | kilometers>" ,
    "metricLabel": "<metricUnitLabel>",
    "nonMetricUnit": "<feet | yards | miles | nauticalMiles>" ,
    "nonMetricLabel": "<nonMetricUnitLabel>"
  },
  "customTextElements":
  [
    {"<textElementName1>" : "<value1>"},
    {"<textElementName2>" : "<value2>"}
  ],
  "legendOptions":
  {
    "operationalLayers":
    [
      {
        "id": "<webmapOperationalLayerId>",
        "sublayerIds":
        [
          <mapServerSublayerId1>,
          <mapServerSublayerId2>
        ]
      }
    ]
  }
}
{
  "titleText": "City Land Use Map",
  "authorText": "Print by: XYZ",
  "copyrightText": "© esri",
  "scaleBarOptions":
  {
    "metricUnit": "kilometers" ,
    "metricLabel": "km",
    "nonMetricUnit": "miles" ,
    "nonMetricLabel": "mi"
  },
  "customTextElements":
  [
    {"townshipName" : "Town ABC"}
  ],
  "legendOptions":
  {
    "operationalLayers":
    [
      {
        "id": "myMapserviceLayer",
        "sublayerIds": [0,1]
      },
      {
        "id": "myWMSLayer",
        "sublayerIds": ["layer1", "layer2"]
      },
      {
        "id": "myFeatureLayer"
      }
    ]
  }
}

Description

titleText (optional): The text of the map title text element is updated if it exists on the layout.

authorText (optional): The text of the author text element is updated if it exists on the layout.

copyrightText (optional): The text of the copyright text element is updated if it exists on the layout.

scaleBarOptions (optional): These update a scale bar if one exists.

  • metricUnit (optional): Sets the units of the scale bar to metric units.
  • metricLabel (optional): String indicating how units should be labeled. Example: KM, Kilometers, or kms. When this is not specified or an empty string is passed in, the text value of the unit is used.
  • nonMetricUnit (optional): Sets the units of the scale bar to non-metric units.
  • nonMetricLabel (optional): String indicating how units should be labeled. Example: Miles or mi. When this is not specified or an empty string is passed in, the text value of the unit is used.

customTextElements (optional): This is an array of name-value pairs. You need to use this if you want to update text of a TextElement (that is not a DynamicText) on the pagelayout. Values must be strings.

legendOptions (optional): Specifies properties of a legend element on the layout.

  • operationalLayers (optional): Specifies the operational layers whose legends will be added to the layout.
    • id: String representing the ID of the layer. The ID must be unique and must match the layer's ID in the operationalLayers element where the operational layer is defined.
    • subLayerIds (optional): An array of sublayers whose element types are string or long and contextual to the operational layer type. For example, for a map service layer, it must be a number; for WMS layer, it must be string. subLayerIds are recommended to be specified for operational layers that have sublayers. Once omitted, in the case of map service and WMS layers, legends from all sublayers are added to the legend element on the layout. For feature or graphics layers, the sublayers property does not need to be set.