Skip To Content

ExportWebMap specification

In this topic

When you attempt to print a map using the PrintingTools geoprocessing service included with ArcGIS Server, you must provide a JavaScript Object Notation (JSON) representation of the map, including its layer and extent information. The JSON must be structured according to the Esri ExportWebMap specification.

When you use the ArcGIS Web APIs, you don't need to worry about constructing the JSON; the APIs take care of it for you. However, this topic is included for reference in case you ever need to construct the JSON yourself. This might happen if you need to call the PrintingTools service directly or run its source geoprocessing tool Export Web Map from another application.

The web map is made of five top-level objects:

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

mapOptions

The object mapOptions is required and defines map display properties.

Syntax:Example
"mapOptions" : {
 "extent" : {
  "xmin" : <xmin>,
  "ymin" : <ymin>,
  "xmax" : <xmax>,
  "ymax" : <ymax>,
  "spatialReference" : {<spatialReference>}
 },
 "scale" : <mapScale>,
 "rotation" : <mapRotation>,
 "spatialReference" :  {<spatialReference>},
 "time" : [
  <timeInstant> | <startTime>,<endTime>
 ]
}
"mapOptions" : {
 "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 that 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 might notice more features on the output map.
  • scale (optional): The map scale at which you want your map to be exported. This property is optional but recommended for getting optimal 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 the output map (for example, 8.5 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:
    1. mapOptions.extent.spatialReference
    2. baseMap.baseMapLayers.spatialReference
    3. Map template's spatial reference
  • time (optional): If there is a time-aware layer and you want it to be drawn at a specified time, 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. Times are always in UTC.

operationalLayers

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, the type property defines the type. For example, a 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.

In case of secured layers, specify the token in a layer definition. A user name and password are not supported as part of the URL.

Note:

For a map service, feature service, or image service, use a URL pointing to the REST endpoint of the service. SOAP endpoints are not supported.

Syntax for operational layers
"operationalLayers" : [
 {
  "id" : "<webmapOperationalLayerId>",
  "url" : "<url1>",
  "token" : "<tokenString1>",
  "title" : "<title1>",
  "opacity" : <opacity1>,
  "visibility" : <true | false>,
  "minScale" : <minScale1>,
  "maxScale" : <maxScale1>
 }
]

Description

Note:

Properties described below are common to all types of operational layers (for example, map service layer, client side graphics, kml layer, and so on). Therefore, they may not be included in this section for each type of operation layer below.

  • id (optional): A string uniquely identifying an operational layer. This is needed mostly for legends.
  • url: The end point of a service. It is not needed for "featureCollection".
  • token (optional): A token to access a secured service.
  • title (optional): Name of an operational layer. If it shows up on the legend, the legend on the layout should support that.
  • visibility (optional): The default value is true.
  • opacity (optional): Value ranges from 0 to 1 (default), with 1 meaning completely opaque and 0 meaning 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.

Syntax for a map service layerExample
"operationalLayers" : [
 {
  "url" : "<url1>",
  "title" : "<title1>",
  "opacity" : <opacity2>,
  "gdbVersion": "<gdbVersion>",
  "visibleLayers" : [
   <layerId1>,
   <layerId2>
  ],
  "layers" : [
   {
    "id": <sublayerId1>,
    "name": <name>,
    "layerDefinition": {
     "definitionExpression": "<definitionExpression>",
     "layerTimeOptions": {
      "useTime": <true | false>,
      "timeDataCumulative": <true | false>,
      "timeOffset": <timeOffset1>,
      "timeOffsetUnits": "<esriTimeUnits>"
     },
     "drawingInfo": {
      "renderer" : {<renderer>},
      "transparency" : <transparency>,
      "scaleSymbols" : <true | false>,
      "showLabels" : <true | false>,
      "labelingInfo" : {<labelingInfo>},
     },
     "source": {<layerSource>},
     "gdbVersion": "<Geodatabase version name>"
    }
   }
  ]
 }
]
"operationalLayers" : [
 {
  "url" : "http://servicesbeta.esri.com/ArcGIS/rest/
           services/HomelandSecurity/operations/
           MapServer",
  "title" : "Homeland security operations",
  "opacity" : 0.8,
  "visibleLayers" : [
   0,
   1
  ]
 }
]

Description

  • 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 don't need to specify group layer's Id. Note that if a map service supports dynamic layers, then "layers" takes precedence over "visibleLayers". For map services that don't use dynamicLayers, only "layerDefinition" in the "layers" property is supported.
  • layers (optional): List of layers to be exported. In case of map services that use dynamic layers, all the layers specified in the "layers" array are exported, while "visibleLayers" are ignored. Use the "name" property to define a name for a layer. This is typically needed when the layer "source" type is "dataLayer".
  • drawingInfo (optional): Use this to override a sublayer's drawing settings, for example, the sublayer's renderer.
    • renderer (optional): When specified, this overrides the sublayer's original renderer.
  • source (optional): Represents the source of a layer that gets added to the map service dynamically per request. See the ArcGIS REST API for more information on how to define source.
  • gdbVersion (optional): Specify this if you want to see features drawn from a different geodatabase version. You can define this at an operational layer level in order to switch all layers to the specified version, or define as a sublayer in a "layers" array to change the geodatabase version for any individual layer.

Syntax for a feature layerExample
"operationalLayers" : [
 {
  "url" : "<url1>",
  "title" : "<title1>",
  "opacity" : <opacity2>,
  "layerDefinition" : {
   "drawingInfo" : {
    "renderer" : {<renderer1>}
   },
   "definitionExpression" : "<definitionExpression1>",
   "objectIds" : [
    <oid1>,
    <oid2>
   ],
   "timeInfo" : {  //optional
    "trackIdField" : "<trackIdFieldName>"
   },
   "geometry" : {<geometry>},
   "geometryType" : "<geometryType>",
   "spatialRel" : "<spatialRel>",
   "relationParam" : "<relationParam>",
   "gdbVersion" : "<geodatabaseVersionName>",
   "source": {<layerSource>}
  },
  "selectionObjectIds" : [
   <oid1>,
   <oid2>
  ],
  "selectionSymbol" : {<symbol>}
 }
]
"operationalLayers" : [
 {
  "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>}
 }
]

Description

  • url (required): The layer's URL. This property should end with /dynamicLayer when a feature layer is based on a layer from a map service that uses dynamic layers.
  • drawingInfo (optional): Specifies the renderer for this layer.
    • To render using a temporal renderer, specify the latestObservationRenderer, trackLinesRenderer, and observationAger properties apart from the renderer.
    • observationAger (optional): The temporal renderer supports two types of observationAger: rampAger and classBreaksAger. For any given request, a layer can contain either a rampAger or a classBreaksAger, but not both.
  • definitionExpression (optional): An SQL statement that restricts which features will be drawn.
  • objectIds (optional): Restricts which features are drawn, based on object IDs.
  • timeInfo (optional):
    • 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.
  • 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): Specifies 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 feature layer is based off a map service that uses dynamic layers.

Syntax for an image service layerExample
"operationalLayers" : [
 {
  "url" : "<url1>",
  "title" : "<title1>",
  "opacity" : <opacity2>,
  "noData" : <noDataValue>,
  "format" : "<jpgpng | png | png8 | png24 | png32 |
               jpg | bmp | gif | tiff >",
  "interpolation" : "<RSP_BilinearInterpolation | 
                     RSP_CubicConvolution | 
                     RSP_Majority | 
                     RSP_NearestNeighbor>",
  "compressionQuality" : <compress>,
  "bandIds" : [
   <bandId1>,
   <bandId2>
  ],
  "mosaicRule" : "<mosaicRule>",
  "renderingRule" : "<renderingRule>",
  "noDataInterpretation" : "<esriNoDataMatchAny | 
                             esriNoDataMatchAll>"
 }
]
"operationalLayers" : [
 {
  "url" : "http://ais3/ArcGIS/rest/services/QB16/
           ImageServer",
  "title" : "Satellite image from 1990",
  "opacity" : 0.8,
  "bandIds" : [
   0,
   1,
   2
  ]
 }
]

Description

Note:

See the ArcGIS REST API for more information on image service layers.

Syntax for a WMS service layer
"operationalLayers" : [
 {
  "url" : "<url1>",
  "title" : "<title1>",
  "type" : "wms",
  "opacity" : <opacity1>,
  "version" : "<wmsServerVersion>",
  "format" : "<jpg | png8 | png24 | png32>",
  "transparentBackground" : <true | false>,
  "layers" : [
   {"name": "<layerName1>"},
   {"name": "<layerName2>"}
  ],
  "visibleLayers" : [
   "<layerName1>",
   "<layerName2>"
  ],
  "styles" : [
   "<style1>",
   "<style2>"
  ]
 }
]

Description

  • type (required): For WMS layers, this must be specified as "wms".
  • format (optional): The requested image format from the server.
  • transparentBackground (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 (optional): 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. If not provided, all layers of a WMS service will be added 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 to which you want to connect. The default is the latest version supported by the given WMS service.

Syntax for a KML layerExample
"operationalLayers" : [
 {
  "type" : "kml",
  "url" : "<url1>",
  "title" : "<title1>",
  "showLabels" : "<true | false>",
  "visibleFolders" : [
   <folderId1>,
   <folderId2>
  ]
 }
]
"operationalLayers" : [
 {
  "type" : "kml",
  "url" : "http://myMachine/.../vermont.kmz",
  "title" : "Vermont weather stations",
  "opacity" : 0.75,
  "showLabels" : true,
  "visibleFolders" : [
   0,
   1,
   2
  ]
 }
]

Description

  • type (required): For this kind of layer, the type must be "kml".
  • url (required): URL to a kmz file.
  • showLabels (optional): By default it is false.
  • visibleFolders: Array of numeric IDs of folders that will be made visible.

Syntax for a client-side imageExample
"operationalLayers" : [
 {
  "type" : "image",
  "title" : "<title1>",
  "opacity" : <opacity2>,
  "extent" : {
   "xmin" : <xmin>,
   "ymin" : <ymin>,
   "xmax" : <xmax>,
   "ymax" : <ymax>,
   "spatialReference" : {<spatialReference>}
  },
  "url" : "<url1>",
  "imageData" : "<base64EncodedImageData>"
 }
]
"operationalLayers" : [
 {
  "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",
  "imageData" : "iVBORw0KGg....",
 }
]

Description

  • type (required): For this kind of layer, the type must be "image".
  • extent (required): The minimum bounding box in which the image fits.
  • url (optional): URL to an image that you want 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.

Syntax for client side graphicsExample
"operationalLayers" : [
 {
  "featureCollection": {
   "layers": [
    {
     "layerDefinition": {
      "name": "<layerName>",
      "geometryType": "<esriGeometryType>",
      "drawingInfo": {<drawingInfo>},
      "objectIdField": "<objectIdFieldName>",  //optional
      "fields": [  //optional
       {
        "name": "<fieldName>",
        "type": "<esriFieldType>",
        "alias": "<fieldAliasName>"
       }
      ]
     },
     "featureSet": {
      "features": [
       {
        "geometry": {<geometry>},
        "attributes": {  //optional
         "<fieldName>": "<value>"
        },
        "symbol": {<symbol>}  //overrides symbol
		                              defined in the renderer
       }
      ]
     }
    }
   ]
  }
 }
]
"operationalLayers": [
  {
   "id": "map_graphics",
   "featureCollection": {
    "layers": [
     {
      "layerDefinition": {
       "name": "pointLayer",
       "geometryType": "esriGeometryPoint",
        "drawingInfo": {
        "renderer": {
         "type": "simple",
         "symbol": {
          "type": "esriSMS",
          "style": "esriSMSCircle",
          "color": [
           76,
           115,
           0,
           255
          ],
          "size": 20,
          "outline": {
           "color": [
            255,
            0,
            0,
            255
           ],
           "width": 1
          }
         }
        }
       }
      },
      "featureSet": {
       "features": [
        {
         "geometry": {
          "x": -10253568.722284,
          "y": 5463514.62565701,
          "spatialReference": {
           "wkid": 102100
          }
         }
        },
        {
         "geometry": {
          "x": -13267022.125398,
          "y": 5463514.62565701,
          "spatialReference": {
           "wkid": 102100
          }
         },
         "symbol": {
          "color": [
           255,
           138,
           255,
           191
          ],
          "size": 12,
          "type": "esriSMS",
          "style": "esriSMSSquare"
         }
        }
       ]
      }
     }
    ]
   }
  }
 ]

Description

  • 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 a 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 the renderer.

Syntax for Comma-Separated Values (CSV) file by URLExample
"operationalLayers" : [
 {
  {
   "type" : "CSV",
   "url" : "<url>",
   "layerDefinition" : {
    "drawingInfo": {
     "renderer": {<renderer>}
    }
   },
   "locationInfo" : {
    "latitudeFieldName" : "<latitudeFieldName>",
    "longitudeFieldName" : "<longitudeFieldName>"
   }
  }
 }
]
"operationalLayers": [
 {
  "type": "CSV",
  "url": "http://servicesbeta.esri.com/demos/exp/data/earthquakes.csv",
  "id": "Earthquakes",
  "title": "Earthquakes",
  "visibility": true,
  "opacity": 1,
  "layerDefinition": {
   "drawingInfo": {
    "renderer": {
     "symbol": {
      "height": 15,
      "type": "esriPMS",
      "url": "http://static.arcgis.com/images/Symbols/Basic/RedSphere.png",
      "width": 15
     },
     "type": "simple"
    },
    "transparency": 0
   }
  },
  "locationInfo": {
   "latitudeFieldName": "lat",
   "longitudeFieldName": "lon"
  }
 }
]

Description

  • latitudeFieldName (required): The name of the field that contains the Y coordinate.
  • longitudeFieldName (required): The name of the field that contains the X coordinate.

Other properties

Note:

See the ArcGIS REST API for more information on the following properties.

  • source
  • renderer
  • symbol
  • textSymbol
  • labelingInfo
  • geometry
  • geometryType
  • spatialRel
  • relationParam

Syntax to define drawingInfo for a temporal rendererExample
"drawingInfo": {
 "observationAger": {<symbolAger>},
 "latestObservationRenderer": {<renderer>},
 "trackLinesRenderer": {<renderer>},
 "renderer": {<renderer>}
}
"drawingInfo": {
 "observationAger": {
  "alphaRange": [
   0,
   255
  ]
 },
 "latestObservationRenderer": {
  "type": "simple",
  "symbol": {
   "type": "esriPMS",
   "url": "http://help.arcgis.com/.../hurr_100_icon.png",
   "contentType": "image/png",
   "width": 30,
   "height": 30
  }
 },
 "trackLinesRenderer": {
  "type": "simple",
  "symbol": {
   "type": "esriSLS",
   "style": "esriSLSSolid",
   "width": 1,
   "color": [
    0,
    0,
    0,
    255
   ]
  }
 },
 "renderer": {
  "type": "simple",
  "symbol": {
   "type": "esriSMS",
   "style": "esriSMSCircle",
   "size": 24,
   "outline": {
    "color": [
     255,
     255,
     255,
     255
    ],
    "width": 1
   }
  }
 }
}

Syntax to define a symbolAger

//rampAger
{
 "colorRange": [
                {<color>}, //for oldest events
                {<color>}  //for newest events
 ],
 "alphaRange": [
                <alpha>, //for oldest events
                <alpha>  //for newest events
 ],
 "sizeRange": [
                <size>, //for oldest events
                <size>  //for newest events
 ]
}

//classBreaksAger
{
 "timeUnits": "<esriTimeUnits>",
 "agerClassBreakInfos" : [{<agerClassBreakInfo>},...]
}

Syntax to define an agerClassBreakInfo

{
 "oldestAge": <age>,
 "color": {<color>},
 "alpha": <alpha>,
 "size": <size>
}

Description

  • The temporal renderer is only supported by feature layers, not by client-side graphics layers or dynamic map service layers.
  • Alpha is an integer value that ranges from 0 to 255.

Geoprocessing result

There are two ways a geoprocessing result can be included:

  1. When a geoprocessing result comes back as a feature set and is drawn as graphics on the client side, send the result as a feature collection.
  2. When the result is drawn by a job's result map service, add a new map service layer in operationalLayers and set the URL property to point to the endpoint of the result. For example:
    • Geoprocessing result from 10.1 or later version: http://gisserver.domain.com:6080/arcgis/rest/services/GPJobMapServiceName/MapServer/jobs/job_id
    • Geoprocessing result from 10.0 and previous: http://gisserver.domain.com/arcgis/rest/services/GPServiceName/GPServer/GPTaskName/jobs/job_id/results/out_param_name

Example: Geoprocessing result as an operational layer that is drawn by a job result map service

"operationalLayers" : [
 {
  "url" : "http://gisserver.domain.com:6080/arcgis/rest/services/Buffer/MapServer/jobs/j9aa6c36d59f44829a0daeadb2d0ff87b",
  "title" : "Geoprocessing Result"
 }
]

baseMap

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

Syntax for baseMapExample
"baseMap" : {
 "title" : "<title>",
 "baseMapLayers" :  [
  {
   "url" : "<url1>",
   "opacity" : <opacity1>
  },
  {
   "url" : "<url2>",
   "opacity" : <opacity2>
  }
 ]
}
"baseMap" : {
 "title" : "Shared Imagery Basemap",
 "baseMapLayers" :  [
  {
   "url" : "http://services.arcgisonline.com/ArcGIS/
            rest/services/ESRI_Imagery_World_2D/
            MapServer",
  },
  {
   "url" : "http://services.arcgisonline.com/ArcGIS/
            rest/services/CSP_Imagery_World_2D/
            MapServer",
  }
 ]
}

Syntax for Bing Maps as a basemapLayerExample
"baseMap" : {
 "title" : "<title>",
 "baseMapLayers" :  [
  {
   "id" : "<id1>",
   "type" : "<BingMapsRoad | BingMapsAerial | 
             BingMapsHybrid>",
   "culture" : "<Bing Maps supported culture>",
   "key" : "<bing_key>" //optional
  }
 ]
}
"baseMap" : {
 "title" : "Bing Maps",
 "baseMapLayers" :  [
  {
   "id" : "BingMap",
   "visibility" : true,
   "type" : "BingMapsRoad",
   "culture" : "fr-ca"
  }
 ]
}

Syntax for OpenStreetMap as a basemapLayerExample
"baseMap" : {
 "title" : "<title>",
 "baseMapLayers" :  [
  {
   "type" : "OpenStreetMap",
   "url" : "<url>",  //optional
   "credits" : "<credits>"  //optional
  }
 ]
}
"baseMap" : {
 "title" : "OpenCycle Map",
 "baseMapLayers" :  [
  {
   "type" : "OpenStreetMap",
   "url" : "http://a.tile.opencyclemap.org/cycle"
  }
 ]
}

Description

  • url (optional): When not specified, openstreetmap.org is used by default.
  • credits (optional): An acknowledgment indicating who contributed to the layer. The value of this property is ignored when "url" is not specified. Instead, the credits for the default OpenStreetMap service is used.

Syntax for WebTiledLayer as a basemapLayerExample
"baseMap" : {
 "title" : "<title>",
 "baseMapLayers" :  [
  {
   "type" : "WebTiledLayer",
   "urlTemplate" : "<urlTemplate1>",
   "subDomains": [  //optional
    <subDomain1>,
    <subDomain2>
   ],
   "tileInfo" : {},  //optional
   "credits" : "<credits>"  //optional
  }
 ]
}
"baseMap" : {
 "title" : "MapQuest",
 "baseMapLayers" :  [
  {
   "type" : "WebTiledLayer",
   "urlTemplate" : "http://{subDomain}.mqcdn.com/
      tiles/1.0.0/vx/map/{level}/{col}/{row}.jpg,
   "subDomains" : [
     "mtile01", 
     "mtile02", 
     "mtile03", 
     "mtile04"
   ]
  }
 ]
}

Description

  • urlTemplate (required): The URL template to retrieve the tiles. The URL template follows a pattern of http://some.domain.com/{level}/{col}/{row}/, where "level" corresponds to a zoom level, and "col" and "row" represent tile column and row, respectively.
  • subDomains (optional): One of the specified subDomains will be used to replace the {subDomain} placeholder in the urlTemplate to form a tile request URL.
  • tileInfo (optional): Defines the tile info for the layer including lods, rows, cols, origin, and spatial reference. If no tileInfo is provided, the layer is assumed to be in web Mercator with the web Mercator tiling scheme. For more information on tileInfo, see the ArcGIS REST API.
  • credits (optional): An acknowledgment indicating who contributed to the layer.

Syntax for WMTS as a basemapLayer
"baseMap" : {
 "title" : "<title>",
 "baseMapLayers" :  [
  {
   "type" : "wmts",
   "url" : "<url1>",
   "layer" : "<layerName>",    //optional
   "style" : "<style>",        //optional
   "format" : "<imageFormat>", //optional
   "tileMatrixSet" : "<tileMatrixSet>"  //optional
  }
 ]
}

exportOptions

This object specifies settings for the output map.

SyntaxExample
"exportOptions" : {
 "dpi" : <dpi>,
 "outputSize" :  [
  <width>,
  <height>
 ]
}
"exportOptions": {
 "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 quotation marks) is passed in as a value to the layout_template parameter. If layout_template is not specified as MAP_ONLY or an empty string, layout_template takes precedence over outputSize.

layoutOptions

This 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.

Note:

This option replaces properties of existing elements only. If an element does not exist in the chosen layout template, the related properties are ignored. For example, if a layout template does not have a copyright text element, no new copyright text element gets added to the layout even though copyrightText element is specified in the layoutOptions.

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.

ExportWebMap text elementCorresponding dynamic text in ArcMap

titleText

<dyn type="document" property="title" />

authorText

<dyn type="document" property="author" />

copyrightText

<dyn type="document" property="credits" />

Note:

Read about dynamicText in ArcGIS Help for more information.

SyntaxExample
"layoutOptions" : {
 "titleText" : "<title>",
 "authorText" : "<authorName>",
 "copyrightText" : "<copyright>",
 "scaleBarOptions" :  {
  "metricUnit" : "<esriMeters | esriKilometers>" ,
  "metricLabel" : "<metricUnitLabel>",
  "nonMetricUnit" : "<esriFeet | esriYards | esriMiles | 
                    esriNauticalMiles>" ,
  "nonMetricLabel" : "<nonMetricUnitLabel>"
 },
 "customTextElements" : [
  {"<textElementName1>" : "<value1>"},
  {"<textElementName2>" : "<value2>"}
 ],
 "legendOptions" : {
  "operationalLayers" : [
   {
    "id" : "<webmapOperationalLayerId>",
    "sublayerIds" : [  //array of string or number
      <mapServerSublayerId1>,
      <mapServerSublayerId2>
    ]
   }
  ]
 }
}
"layoutOptions": {
 "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": [
   { //for dynamic mapservicelayer
    "id": "myMapserviceLayer",
    "subLayerIds": [ //array of integer
     0,
     1 
    ]
   },
   { //for WMS layer
    "id": "myWMSLayer",
    "subLayerIds": [ //array of string
     "layer1",
     "layer2" 
    ]
   },
   { //for FeatureLayer
    "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, for 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 nonmetric units.
    • nonMetricLabel (optional): String indicating how units should be labeled, for 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 text element (that is not dynamic text) on the page layout. Values must be strings.
  • legendOptions (optional): Specifies properties of a legend element on the layout. Please note that when a legend element on a layout is found empty (it does not have layer in it), it gets removed by the printing service.
    • 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 a WMS layer, it must be a string. It is recommended that you specify subLayerIds values 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.

Limitations

Feature-level symbols overridden in notes layers are not supported when the renderer type is class breaks or simple.