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 / Table   Legend   All Layers / Tables   KML Image   Map Service Extension

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.

From 10 onward, in addition to layers, map services could also publish standalone tables. The response includes a new tables property that contains some basic information about tables. The child layer resource is now a Layer / Table resource in that it represents either a layer or a table depending on the ID that was specified.

Support for time-aware map services was added at 10. If the map supports quering and exporting maps based on time, the response will include a timeInfo property which includes information such as the map's time extent and the map's native time reference. However, note that the REST API always encodes time in UTC (milliseconds from epoch).

At 10.0 SP1, support for a Map Service Legend child resource was added.

At 10.0 SP1, mapservice resource includes scale information (minScale and maxScale) for layers.

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

{
"currentVersion": <currentVersion>, //Added at 10.0 SP1
"serviceDescription" : "<serviceDescription>",
"mapName" : "<mapName>"
"description": "<description>",
"copyrightText" : "<copyrightText>",
"layers": [ //the spatial layers published by this service
    {
    "id" : <layerId1>, 
    "name" : "<layerName1>", 
    "defaultVisibility" : <true|false>, 
    "parentLayerId" : <parentLayerId1>,
    "subLayerIds" : [<subLayerId11>, <subLayerId12>]
    "minScale": <minScale1>, //Added at 10.0 SP1
    "maxScale": <maxScale1>
    },
    {
    "id" : <layerId2>, 
    "name" : "<layerName2>", 
    "defaultVisibility" : <true|false>, 
    "parentLayerId" : <parentLayerId2>,
    "subLayerIds" : [<subLayerId21>, <subLayerId22>]
    "minScale": <minScale1>,
    "maxScale": <maxScale1>
    }
],
"tables": [ //the tables published by this service - from 10 onward
    {
    "id" : <tableId1>, 
    "name" : "<tableName1>"
    },
    {
    "id" : <tableId2>, 
    "name" : "<tableName2>"
    }
],
"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>},
//from 10 onward - if the map supports querying and exporting maps based on time
"timeInfo" : {
  "timeExtent" : [<startTime>, <endTime>],
  "timeReference" : {
    "timeZone" : "<timeZone>",
    "respectsDaylightSaving" : <true | false>
  }
},
"units" : "<units>",
"supportedImageFormatTypes" : "<supportedImageFormatTypes>",
"documentInfo": {
    "<key1>" : "<value1>",
    "<key2>" : "<value2>"
},
//comma separated list of supported capabilities - e.g. "Map,Query,Data"
"capabilities" : "<capabilities>"
}

JSON Response Example

{
"currentVersion": 10.01,
"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, "minScale": 0, "maxScale": 0},
{"id" : 1, "name" : "States", "defaultVisibility" : true, "parentLayerId" : -1, "subLayerIds" : null, "minScale": 0, "maxScale": 0},
{"id" : 2, "name" : "Counties", "defaultVisibility" : false, "parentLayerId" : -1, "subLayerIds" : [3, 4], "minScale": 0, "maxScale": 0},
{"id" : 3, "name" : "Large Counties", "defaultVisibility" : false, "parentLayerId" : 2, "subLayerIds" : null, "minScale": 0, "maxScale": 0},
{"id" : 4, "name" : "Small Counties", "defaultVisibility" : false, "parentLayerId" : 2, "subLayerIds" : null, "minScale": 0, "maxScale": 0}
],
"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"
}, "capabilities" : "Map,Query,Data"
}