English

How To: Execute a Export Web Map task operation from the REST endpoint

Summary

The Export Web Map task is an operation of the PrintingTools geoprocessing service which takes the state of a web application and returns either a page layout or map image of the specified area of interest in raster or vector format. For more information, refer to:

The input for the Export Web Map task is formatted using JavaScript object notation (JSON), and should contain information about the layers, graphics and other settings within the web map. For more information, refer to: ExportWebMap specification.

Procedure

Executing the Export Web Map task through the REST endpoint is an effective way to confirm that the PrintingTools geoprocessing service, or any custom print service, is working as expected prior to consuming it within a web application.

  1. Access the Execute Web Map task operation from the REST endpoint:
    http://<gisserver.domain.com>:6080/arcgis/rest/services/Utilities/PrintingTools/GPServer/Export%20Web%20Map%20Task/execute

    Image of the execute task page in the REST endpoint
     
  2. Enter values for the Web Map as JSON, Format and Layout Template parameters. A sample web map as JSON can be found below:
    Note:
    The following JSON code section does not work if it is formatted. Starting in 10.6, print services do not accept formatted JSON. However, if publishing a print service from ArcMap (with the Export Web Map geoprocessing tool) on a 10.6 or above server, formatted JSON can be used.
    {"mapOptions":{"extent":{"xmin":-14029324.953095315,"ymin":3275060.5972898453,"xmax":-6803885.543356096,"ymax":7545750.241638077,"spatialReference":{"wkid":102100}},"scale":18489297.737236},"operationalLayers":[{"url":http://<gisserver.domain.com>:6080/arcgis/rest/services/SampleWorldCities/MapServer",}],"exportOptions":{"outputSize":[1400,1000],"dpi":96}}
    This sample is configured to consume the Sample World Cities map service:
    http://<gisserver.domain.com>:6080/arcgis/rest/services/SampleWorldCities/MapServer
  3. Execute the task.

Related Information