FRAMES | NO FRAMES Description | Parameters | Examples | Response
Map Service

This is an archive of a previous version of the ArcGIS REST API. The current version can be found at http://resources.arcgis.com/en/help/arcgis-rest-api/

URL http://<catalog-url>/<serviceName>/MapServer
Supported Operations Export Map  Identify  Find  Generate KML
Parent Resource Catalog
Child Resources Map Tile  Layer  KML Image

Description

Map services offer access to map and layer content. Map services can either be cached or dynamic. A map service that fulfills requests with pre-created tiles from a cache instead of dynamically rendering part of the map is called a cached map service. A dynamic map service requires the server to render the map each time a request comes in. Map services using a tile cache can significantly improve performance while delivering maps, while dynamic map services offer more flexibility. Map services should always be published as pooled services.

The REST API map service resource represents a map service. This resource works only with the default data frame of your published map document. This resource provides basic information about the map, including the layers that it contains, whether the map is cached or not, its spatial reference, initial and full extents, map units, and copyright text. It also provides some metadata associated with the service such as its service description, its author, and keywords. If the map is cached, then additional information about its tiling scheme such as the origin of the cached tiles, the levels of detail, and tile size is included. Note that multi-layer caches are only accessible in REST via export, and these requests are treated as a dynamic map service. Tile access is not supported in REST for multi-layer caches.

The map service resource supports several operations:

Map services do not expose editing capabilities. They provide read-only access to feature and attribute content.

Resource Hierarchy

Map Service

Parameters

Parameter Details
f Description: The response format. The default response format is html.

Values: html | json | kmz | lyr | nmf | jsapi | ve | gmaps

Example Usage

Example 1: URL for the "ESRI_StateCityHighway_USA" map service on sampleserver1.

http://sampleserver1.arcgisonline.com/ArcGIS/rest/services/Specialty/ESRI_StateCityHighway_USA/MapServer

JSON Response Syntax

Note: The supportedImageFormatTypes property was added to the JSON response at 9.3.1

{
"serviceDescription" : "<serviceDescription>", "mapName" : "<mapName>" "description": "<description>",
"copyrightText" : "<copyrightText>"
"layers": [
{
"id" : <layerId1>,
"name" : "<layerName1>",
"defaultVisibility" : <true|false>,
"parentLayerId" : <parentLayerId1>,
"subLayerIds" : [<subLayerId11>, <subLayerId12>]
},
{
"id" : <layerId2>,
"name" : "<layerName2>",
"defaultVisibility" : <true|false>,
"parentLayerId" : <parentLayerId2>,
"subLayerIds" : [<subLayerId21>, <subLayerId22>]
}
],
"spatialReference" : {
<spatialReference>},
"singleFusedMapCache" : <true | false>,
"tileInfo": {
"rows" : <rows>, "cols" : <cols>, "dpi" : <dpi>, "format" : <format>, "compressionQuality" : <quality>,
"origin" : {<point>},
"spatialReference" : {<spatialReference>},
"lods": [
{"level" : <level1>, "resolution" : <resolution1>, "scale" : <scale1> },
{"level" : <level2>, "resolution" : <resolution2>, "scale" : <scale2> }
]
},
"initialExtent" : {<envelope>},
"fullExtent" : {<envelope>},
"units" : "<units>",
"supportedImageFormatTypes" : "<supportedImageFormatTypes>",
"documentInfo": {
"<key1>" : "<value1>",
"<key2>" : "<value2>"
}
}

JSON Response Example

{
"serviceDescription" : "Test Map Service Description", "mapName" : "Street Map Pro Data", "description": "Street Map USA",
"copyrightText" : "ESRI",
"layers": [
{"id" : 0, "name" : "Cities", "defaultVisibility" : true, "parentLayerId" : -1, "subLayerIds" : null},
{"id" : 1, "name" : "States", "defaultVisibility" : true, "parentLayerId" : -1, "subLayerIds" : null},
{"id" : 2, "name" : "Counties", "defaultVisibility" : false, "parentLayerId" : -1, "subLayerIds" : [3, 4]},
{"id" : 3, "name" : "Large Counties", "defaultVisibility" : false, "parentLayerId" : 2, "subLayerIds" : null},
{"id" : 4, "name" : "Small Counties", "defaultVisibility" : false, "parentLayerId" : 2, "subLayerIds" : null}
],
"spatialReference" : {"wkid" : 4326},
"singleFusedMapCache" : true,
"tileInfo": {
"rows" : 512, "cols" : 512, "dpi" : 96, "format" : "JPEG", "compressionQuality" : 75,
"origin" : {"x" : -130.0, "y" : 50.0},
"spatialReference" : {"wkid" : 4326},
"lods": [
{"level" : 0, "resolution" : 8.46, "scale" : 32000.0 },
{"level" : 1, "resolution" : 4.23, "scale" : 16000.0 },
{"level" : 2, "resolution" : 2.11, "scale" : 8000.0 },
{"level" : 3, "resolution" : 1.05, "scale" : 4000.0 },
{"level" : 4, "resolution" : 0.52, "scale" : 2000.0 }
]
},
"initialExtent" : {
"xmin" : -109.55, "ymin" : 25.76, "xmax" : -86.39, "ymax" : 49.94,
"spatialReference" : {"wkid" : 4326}
},
"fullExtent" : {
"xmin" : -130.0, "ymin" : 24.0, "xmax" : -65.0, "ymax" : 50.0,
"spatialReference" : {"wkid" : 4326}
},
"units" : "esriDecimalDegrees",
"supportedImageFormatTypes": "PNG32,PNG24,PNG,JPG,DIB,TIFF,EMF,PS,PDF,GIF,SVG,SVGZ",
"documentInfo": {
"Title" : "StreetMap USA.mxd",
"Author" : "ESRI Data Team",
"Comments" : "ESRI Data and Maps 2004",
"Subject" : "Street level data for the US",
"Category" : "vector",
"Keywords" : "StreetMap USA"
}
}