- URL:
- https://<mapservice-url>/export
- Methods:
GET
- Required Capability:
- Map
- Version Introduced:
- 9.3
Description
The export operation is performed on a map service resource. The result of this operation is a map image resource. This resource provides information about the exported map image such as its URL, its width and height, extent and scale.
Apart from the usual response formats of HTML and JSON, users can also request a format called image
while performing this operation. When users perform an export with the format of image
, the server responds by directly streaming the image bytes to the client. With this approach, you don't get any information associated with the exported map other than the actual image.
The extent displayed in the exported map image may not exactly match the extent sent in the box parameter when the aspect ratio of the image size does not match the aspect ratio of the box. The aspect ratio is the height divided by the width. In these cases, the extent is resized to prevent map images from appearing stretched. The exported map's extent is sent along with the JSON and HTML responses, and may be used in client-side calculations. It's important that the client-side code update its extent based on the response.
New in 10.9
Supports the following new parameters. These parameters are only supported by map services published from ArcGIS Pro.
time
to control whether you want to include or exclude start and end values specified in theRelation time
parameter.
New at 10.8
Supports the following new parameters. These parameters are only supported by map services published from ArcGIS Pro.
clipping
to mask out layers outside of a clip polygon.spatial
to draw or query only features that meet the spatial filter criteria.Filter
New at 10.6.1
Supports the following new parameter:
historic
to query from a given moment in an archive enabled layer.Moment
New at 10.5
Supports the following new parameters:
datum
to provide a desired datum transformation to be applied while features get projected.Transformations map
to set values to ranges applicable to all layers with the same ranges in the map service.Range Values layer
to set range values specific layers.Range Values layer
to set values to parameterized filters to specific layers.Parameter Values
Request parameters
Parameter | Details |
---|---|
(Bounding Box) | (Required) The extent (bounding box) of the exported image. Unless the The Syntax
Example
|
(Bounding Box Spatial Reference) | The spatial reference of the |
(Layers) | Determines which layers appear on the exported map. There are four ways to specify which layers are shown:
Syntax
Example
|
(Layer Definitions) | Allows you to filter the features of individual layers in the exported map by specifying definition expressions for those layers. The definition expression for a layer that is published with the service always will be honored. Syntax
|
(Image Size) | The size (width and height) of the exported image in pixels. If the Syntax
Example
|
(Image Spatial Reference) | The spatial reference of the exported image. The spatial reference can be specified as either a well-known ID or as a spatial reference json object. If the |
(Historic Moment) | It returns an output image with features from a specific epoch time. This parameter applies only if the layer is archiving enabled and the Syntax
Example
|
(Image Format) | The format of the exported image. The default format is Values: |
(Background Transparent) | If Values: |
(DPI) | The device resolution of the exported image (dots per inch). If the dpi is not specified, an image with a default dpi of 96 will be exported. Example
|
(Time) | The time instant or time extent of the exported map image. Syntax
Example
|
(Time Relation) | Allows you to control whether to include or exclude features that are at the beginning or the end of a time window. The default value is Syntax
Example
|
(Layer Time Options) | The time options per layer. Users can indicate whether the layer should use the time extent specified by the Syntax
Example
|
(Dynamic Layers) | Use this parameter to modify the layer drawing order, change layer drawing info, and change the layer data source version for this request. New layers ( Syntax:
See the Dynamic Layers codeblock examples section below for examples. |
(Geodatabase Version Name) | Use this parameter to specify the geodatabase version. Syntax
Example
|
(Map Scale) | Use this parameter to export a map image at a specific scale, with the map centered around the center of the specified bounding box ( Syntax
Examples
|
(Rotation) | Use this parameter to export a map image rotated at a specific angle, with the map centered around the center of the specified bounding box ( Syntax
Exmaple
|
(Datum Transformations) | Use it to apply one or more datum transformations to the map when For a list of valid datum transformation ID values (WKID) and well-known text (WKT) strings, see Using spatial references. For more information on datum transformation, see the Syntax
Example
|
(Layer Parameter Values) | It allows you to filter the features of individual layers in the exported map by specifying a value or values to an array of preauthored parameterized filters for those layers. When this value is not specified for any parameter in a request, the default value assigned during authoring is used instead. When a Syntax
Example
|
(Map Range Values) | It allows you to filter features in the exported map from all layers that are within the specified range instant or extent. Note: Check Syntax
Example
|
(Layer Range Values) | It allows you to filter the features of individual layers in the exported map by specifying a value or values to an array of preauthored parameterized filters for those layers. When this value is not specified for any parameter in a request, the default value assigned during authoring is used instead. When a Syntax
Example
|
(Clipping) | This parameter was added at 10.8. It allows you to mask out layers outside of the clip polygon in the exported map. Clipping can mask out any layer type, in other words, feature layers, raster layers, TIN layers, and so on. Optionally, you can use Syntax
Example
|
(Spatial Filter) | This parameter was added at 10.8. It allows you to filter out features from all feature layers based on the input spatial filter. It is like Syntax
Example
|
(Format) | The response format. The default response format is Values: |
Example usage
Example 1: Export a map. Include only the bounding box.
https://machine.domain.com/arcgis/rest/services/Specialty/ESRI_StateCityHighway_USA/MapServer/export?bbox=-127.8,15.4,-63.5,60.5
Example 2: Export a map. Change image
to 102004 (USA_Contiguous_Lambert_Conformal_Conic projection):
https://machine.domain.com/arcgis/rest/services/Specialty/ESRI_StateCityHighway_USA/MapServer/export?bbox=-127.8,15.4,-63.5,60.5&bboxSR=&layers=&size=&imageSR=102004&format=&transparent=false&dpi=&f=html
Example 3: Export a map. Change image
to 102004 (USA_Contiguous_Lambert_Conformal_Conic projection), image size
to a width and height of 800x600, format
to gif
, and transparent
to false
.
https://machine.domain.com/arcgis/rest/services/Specialty/ESRI_StateCityHighway_USA/MapServer/export?bbox=-115.8,30.4,-85.5,50.5&bboxSR=&layers=&size=800,600&imageSR=102004&format=gif&transparent=false&dpi=&f=html
Example 4: Export the same map as above but change the output format to pretty JSON (pjson
).
https://machine.domain.com/arcgis/rest/services/Specialty/ESRI_StateCityHighway_USA/MapServer/export?bbox=-115.8,30.4,-85.5,50.5&bboxSR=&layers=&size=800,600&imageSR=102004&format=gif&transparent=false&dpi=&f=pjson
Example 5: Export a map with dynamic layers. Update an existing map layer symbology.
https://machine.domain.com/arcgis/rest/services/Census/MapServer/export?bbox=-183.78001472868405,16.300709121618663,-61.406854669684265,74.03030803096895&bboxSR=&layers=&layerDefs=&size=&imageSR=&format=png&transparent=false&dpi=&time=&layerTimeOptions=&dynamicLayers=[{"id":101,"source":{"type":"mapLayer","mapLayerId":3},"drawingInfo":{"renderer": {"type":"simple", "symbol": {"type":"esriSFS","style":"esriSFSSolid","color":[255,0,0,255],"outline":{"type":"esriSLS","style":"esriSLSSolid","color":[0,255,0,255],"width":1}}}}}]&gdbVersion=&f=html
Dynamic layer request examples
[
{ //disable time on existing map service layer and turn off labels
"id": 501,
"source":
{
"type": "mapLayer",
"mapLayerId": 0
},
"drawingInfo": {
"showLabels": false
},
"layerTimeOptions": {
"useTime": false
}
}
},
{ //add a new layer from registered workspace and label features with a feature attribute value {TaxLotId]
"id": 502,
"source": {
"type": "dataLayer",
"dataSource": {
"type": "table",
"workspaceId": "MAP",
"dataSourceName": "MAP.user1.Taxlots"
}
},
"drawingInfo": {
"renderer": {
"type": "simple",
"symbol": {
"type": "esriSFS",
"style": "esriSFSSolid",
"color": [166,36,0,255],
"outline": {
"type": "esriSLS",
"style": "esriSLSSolid",
"color": [110,110,110,255],
"width": 1.0
}
},
"label": "TaxLots",
"description": ""
},
"transparency": 60,
"showLabels": true,
"labelingInfo": [
{
"labelPlacement": "esriServerPolygonPlacementAlwaysHorizontal",
"labelExpression": "[TaxLotId]",
"useCodedValues": false,
"symbol": {
"type": "esriTS",
"color": [255,255,0,255],
"verticalAlignment": "bottom",
"horizontalAlignment": "left",
"font": {
"family": "Arial",
"size": 12,
"style": "normal",
"weight": "bold",
"decoration": "none"
}
},
"minScale": 15000,
"maxScale": 30000,
"where": ""
}
]
}
},
{ //change the Version of existing map service layer
"id": 503,
"source": {
"type": "mapLayer",
"mapLayerId": 1,
"gdbVersion": "USER1"
},
"definitionExpression": "neighborhood = 'French Quarter'"
},
{ //add a raster from registered workspace
"id": 504,
"source": {
"type": "dataLayer",
"dataSource": {
"type": "raster",
"workspaceId": "rasterWS",
"dataSourceName": "NewOrleans.tif"
}
},
"drawingInfo": {
"transparency": 0
}
}
]
JSON Response syntax
{
"href": "<href>",
"width": <width>,
"height": <height>,
"extent": {<envelope>},
"scale": <scale>
}
JSON Response example
{
"href": "https://atlantic/arcgisoutput/_ags_map42ef5eae899942a9b564138e184a55c9.png",
"width": 400,
"height": 400,
"extent": {
"xmin": -109.55,
"ymin": 25.76,
"xmax": -86.39,
"ymax": 49.94,
"spatialReference": {
"wkid": 4326,
"latestWkid": 4326
}
},
"scale" : 2.53E7
}