Export Web Map (Server)

Summary

Takes the state of a web app (for example, included services, layer visibility settings, and client-side graphics) and returns a printable page layout or basic map of the specified area of interest.

Usage

  • The input for this tool is a piece of text in JavaScript object notation (JSON) format describing the layers, graphics, and other settings in the web map. The JSON must be structured according to the ExportWebMap specification.

  • This tool is included in ArcGIS Server to support web services for printing, including the PrintingTools preconfigured service. The ArcGIS web APIs for JavaScript, Flex, and Silverlight use the PrintingTools service to generate images for map printing.

  • For advanced printing scenarios—such as swapping out service layers with local vector data or creating map books—use the ConvertWebMapToArcGISProject() function in the Python arcpy.mp module instead of this tool. To make your Python script available to a web app, you can expose the script through an ArcGIS Server geoprocessing service. For more information, see Printing in web applications in the ArcGIS Server help.

Syntax

ExportWebMap(Web_Map_as_JSON, Output_File, {Format}, {Layout_Templates_Folder}, {Layout_Template})
ParameterExplanationData Type
Web_Map_as_JSON

A JSON representation of the state of the map to be exported as it appears in the web app. See the ExportWebMap specification to understand how this text should be formatted. The ArcGIS web APIs (for JavaScript, Flex, Silverlight, and so on) allow you to get this JSON string from the map.

String
Output_File

The output file name. The extension of the file depends on the Format parameter.

File
Format
(Optional)

Specifies the format in which the map image for printing will be delivered.

  • PNG88-bit Portable Network Graphics (PNG8). This is the default.
  • PDFPortable Document Format (PDF)
  • PNG3232-bit Portable Network Graphics (PNG32)
  • JPG Joint Photographic Experts Group (JPG)
  • GIF Graphics Interchange Format (GIF)
  • EPS Encapsulated PostScript (EPS)
  • SVGScalable Vector Graphics (SVG)
  • SVGZCompressed Scalable Vector Graphics (SVGZ)
  • AIXAdobe Illustrator Exchange (AIX)
Note:

The background of the output file is always opaque.

String
Layout_Templates_Folder
(Optional)

The full path to the folder containing layout pages (.pagx files ) to be used as layout templates. The default location is <install_directory>\Resources\ArcToolBox\Templates\ExportWebMapTemplates.

Folder
Layout_Template
(Optional)

The name of a template from the list or the keyword MAP_ONLY. When MAP_ONLY is chosen or an empty string is passed in, the output map will not contain any page layout elements such as title, legend, or scale bar.

String

Environments

This tool does not use any geoprocessing environments.

Licensing information

  • Basic: Yes
  • Standard: Yes
  • Advanced: Yes

Related topics