Map Service

Description

Map services offer access to the contents of a map hosted on a server. Map services can expose different levels of capabilities. When a map service is hosted on ArcGIS Online or Portal for ArcGIS, it exposes a set of tiled images that are used by the client for rapid map navigation. When a map service is hosted on an ArcGIS Server site, it exposes additional functionality, such as dynamic drawing, query, and search. With ArcGIS Server, further web services may be available through the map service root URL that allow network analysis, vector feature editing, and so forth.

The REST API Map Service 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 or not the map is cached, 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, additional information about its tiling scheme, such as the origin of the cached tiles, the levels of detail, and tile size, is included.

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

Map services hosted by ArcGIS Online and Portal for ArcGIS

Map services hosted by ArcGIS Online or Portal for ArcGIS can only return tiles from the server's cache; they cannot draw images dynamically, nor do they allow query of the individual features behind the map. You can support queries and informational pop-up windows in your applications using feature services in conjunction with your map services.

Accordingly, some of the resources, operations, and properties mentioned in this section of the documentation do not apply to map services hosted by ArcGIS Online or Portal for ArcGIS.

Map services hosted by ArcGIS Server

Map services hosted by ArcGIS Server support a larger set of operations as follows:

New in 10.9

New in 10.8.1

New in 10.8

New in 10.7.1

New in 10.7

New in 10.6.1

New in 10.5

New at 10.4

New at 10.3

New at 10.2

New at 10.1 SP1

New at 10.1

New at 10.0 SP1

New at 10.0

Request parameters

Parameter

Details

returnUpdates

If true, this resource returns the updated time extent. If the service is not time aware, the resource will return an empty response.

Values: true | false

option
LegacyLegacy:

Support for footprints has been removed at ArcGIS Enterprise 11.1, and the footprints value for this parameter has been deprecated.

If option is footprints, the footprint of the map service is returned as a feature collection. This feature collection can be viewed in ArcGIS Online. This option is only supported if the response format is json.

Values: footprints

outSR
LegacyLegacy:

Support for footprints has been removed at ArcGIS Enterprise 11.1.

The spatial reference of the geometry returned in footprints. This parameter is supported only when option is specified as footprints. The spatial reference should be specified as a well-known ID. If outSR is not specified, the geometry is returned in GCS_WGS_1984.

f

The response format. The default response format is html.

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

Example usage

The following is a sample request URL for the ESRI_StateCityHighway_USA map service:

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

JSON Response syntax

Example one

{
  "currentVersion": <currentVersion>, //Added at 10.0 SP1
  "serviceDescription": "<serviceDescription>",
  "mapName": "<mapName>"
  "description": "<description>",
  "copyrightText": "<copyrightText>",
  "supportsDynamicLayers": <true|false>, //Added at 10.1
  "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>},
  "timeInfo": {  //from 10 onward - if the map supports querying and exporting maps based on time
    "timeExtent": [<startTime>, <endTime>],
    "timeReference": {
      "timeZone": "<timeZone>",
      "respectsDaylightSaving": <true | false>
    },
    "timeRelation": "<esriTimeRelationOverlaps | esriTimeRelationOverlapsStartWithinEnd | esriTimeRelationAfterStartOverlapsEnd>",
    "defaultTimeInterval": <time interval>,
    "defaultTimeIntervalUnits": "<esriTimeUnitsCenturies | esriTimeUnitsDays | esriTimeUnitsDecades |
                             esriTimeUnitsHours | esriTimeUnitsMilliseconds | esriTimeUnitsMinutes |
                             esriTimeUnitsMonths | esriTimeUnitsSeconds | esriTimeUnitsWeeks | esriTimeUnitsYears |
                             esriTimeUnitsUnknown>",
    "defaultTimeInterval": <time interval>,
    "defaultTimeWindow": <time window>,
    "hasLiveData": <true | false>,
    "liveModeOffsetDirection": "<pastAndFuture | past | future>"
  },
  "units": "<units>",
  "supportedImageFormatTypes": "<supportedImageFormatTypes>",
  "documentInfo": {
    "<key1>": "<value1>",
    "<key2>": "<value2>"
  },
  "capabilities": "<capabilities>",  //comma separated list of supported capabilities - e.g. "Map,Query,Data"
  "maxRecordCount": <maxRecordCount>, //Added at 10.1
  "maxImageHeight": <maxImageHeight>, //Added at 10.1
  "maxImageWidth": <maxImageWidth>, //Added at 10.1
  "minScale": <minimum map scale>, //Added at 10.1
  "maxScale": <maximum map scale>, //Added at 10.1
  "tileServers": ["<tileServerUrl1>","<tileServerUrl2>","<tileServerUrl2>"], //Added at 10.1
  "supportedQueryFormats": "<query output formats>",
  "exportTilesAllowed": <true | false>,
  "maxExportTilesCount: <export tiles limit>,
  "supportedExtensions": "<FeatureServer,KmlServer,MobileServer,WCSServer,WFSServer,WMSServer,NAServer,SchematicsServer>",
  "resampling": <true | false> // Added at 10.3
}

Example two

The following example demonstrates the response when requesting updated information from the service:

{
  "timeExtent": [
    <startTime>, 
    <endTime>
  ],
  "fullExtent": {
    "xmin": <xmin>,
    "ymin": <ymin>,
    "xmax": <xmax>,
    "ymax": <ymax>,
    "spatialReference": <spatialReference>
  }
}

Example three

The following example demonstrates the response when requesting footprint for a service:

{
  {
    "featureCollection": {
      "layers": [
        {
          "layerDefinition": {
            "type": "Feature Layer",
            "geometryType": "esriGeometryPoint",
            "extent": {
              <envelope>
            },
            "objectIdField": "id",
            "displayFieldName": "<displayFieldName>",
            "drawingInfo": {
              "renderer": {
                "type": "simple",
                "label": "<label>",
                "description": "",
                "symbol": {
                  "height": 24,
                  "xoffset": 0,
                  "yoffset": 0,
                  "width": 24,
                  "contentType": "image/png",
                  "type": "esriPMS",
                  "imageData": "<imageData>",
                  "url": "<imageUrl>"
                }
              }
            },
            "fields": [
              {
                "name": "id",
                "alias": "ID",
                "type": "esriFieldTypeOID"
              },
              {
                "name": "title",
                "alias": "Title",
                "type": "esriFieldTypeString"
              },
              {
                "name": "summary",
                "alias": "Summary",
                "type": "esriFieldTypeString"
              },
              {
                "name": "description",
                "alias": "Description",
                "type": "esriFieldTypeString"
              },
              {
                "name": "tags",
                "alias": "Tags",
                "type": "esriFieldTypeString"
              },
              {
                "name": "type",
                "alias": "Type",
                "type": "esriFieldTypeString"
              },
              {
                "name": "thumbnail",
                "alias": "Thumbnail",
                "type": "esriFieldTypeString"
              },
              {
                "name": "xmin",
                "alias": "xmin",
                "type": "esriFieldTypeDouble"
              },
              {
                "name": "ymin",
                "alias": "ymin",
                "type": "esriFieldTypeDouble"
              },
              {
                "name": "xmax",
                "alias": "xmax",
                "type": "esriFieldTypeDouble"
              },
              {
                "name": "ymax",
                "alias": "ymax",
                "type": "esriFieldTypeDouble"
              },
              {
                "name": "accessInformation",
                "alias": "Access Information",
                "type": "esriFieldTypeString"
              },
              {
                "name": "licenseInfo",
                "alias": "License Information",
                "type": "esriFieldTypeString"
              },
              {
                "name": "credits",
                "alias": "Credits",
                "type": "esriFieldTypeString"
              },
              {
                "name": "link",
                "alias": "Link",
                "type": "esriFieldTypeString"
              },
              {
                "name": "arcgisJslink",
                "alias": "ArcgisJsLink",
                "type": "esriFieldTypeString"
              }
            ]
          },
          "featureSet": {
            "geometryType": "esriGeometryPoint",
            "spatialReference": {
              "wkid": <wkid>
            },
            "features": [
              {
                "geometry": {
                  <point>
                },
                "attributes": {
                  "id": 1,
                  "title": "<title>",
                  "summary": "<summary>",
                  "description": "<description>",
                  "tags": "[\"<tag1>\,\"<tag2>\"]",
                  "type": "MapServer",
                  "thumbnail": "<thumbnailUrl>",
                  "xmin": <xmin>,
                  "ymin": <ymin>,
                  "xmax": <xmax>,
                  "ymax": <ymax>,
                  "accessInformation": "<accessInformation>",
                  "licenseInfo": "<licenseInfo>",
                  "credits": "<credits>",
                  "link": "<serviceResourceLink>",
                  "arcgisJslink": "<View in JSAPI Link>"
                }
              }
            ]
          },
          "popupInfo": {
            "title": "{title} ({type})",
            "fieldInfos": [
              {
                "fieldName": "id",
                "label": "ID",
                "visible": false
              },
              {
                "fieldName": "title",
                "label": "Title",
                "visible": true
              },
              {
                "fieldName": "summary",
                "label": "Summary",
                "visible": true
              },
              {
                "fieldName": "description",
                "label": "Description",
                "visible": true
              },
              {
                "fieldName": "tags",
                "label": "Tags",
                "visible": true
              },
              {
                "fieldName": "type",
                "label": "Type",
                "visible": true
              },
              {
                "fieldName": "thumbnail",
                "label": "Thumbnail",
                "visible": false
              },
              {
                "fieldName": "xmin",
                "label": "xmin",
                "format": {
                  "places": 2,
                  "digitSeparator": false
                },
                "visible": false
              },
              {
                "fieldName": "ymin",
                "label": "ymin",
                "format": {
                  "places": 2,
                  "digitSeparator": false
                },
                "visible": false
              },
              {
                "fieldName": "xmax",
                "label": "xmax",
                "format": {
                  "places": 2,
                  "digitSeparator": false
                },
                "visible": false
              },
              {
                "fieldName": "ymax",
                "label": "ymax",
                "format": {
                  "places": 2,
                  "digitSeparator": false
                },
                "visible": false
              },
              {
                "fieldName": "accessInformation",
                "label": "Access Information",
                "visible": true
              },
              {
                "fieldName": "licenseInfo",
                "label": "License Information",
                "visible": true
              },
              {
                "fieldName": "credits",
                "label": "Credits",
                "visible": true
              },
              {
                "fieldName": "link",
                "label": "Link",
                "visible": true
              }
            ],
            "description": null,
            "showAttachments": false,
            "mediaInfos": [
              {
                "type": "image",
                "caption": "Initial Extent: [{xmin}, {ymin}] - [{xmax}, {ymax}]",
                "value": {
                  "sourceURL": "{thumbnail}",
                  "linkURL": "{arcgisJslink}"
                }
              }
            ]
          }
        }
      ]
    }
  }
}

JSON Response examples

Example one

{
  "currentVersion": 10.8,
  "serviceDescription": "Test Map Service Description",
  "mapName": "Street Map Pro Data",
  "description": "Street Map USA",
  "copyrightText": "ESRI",
  "supportsDynamicLayers": false,
  "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,
      "y": 50
    },
    "spatialReference": {
      "wkid": 4326
    },
    "lods": [
      {
        "level": 0,
        "resolution": 8.46,
        "scale": 32000
      },
      {
        "level": 1,
        "resolution": 4.23,
        "scale": 16000
      },
      {
        "level": 2,
        "resolution": 2.11,
        "scale": 8000
      },
      {
        "level": 3,
        "resolution": 1.05,
        "scale": 4000
      },
      {
        "level": 4,
        "resolution": 0.52,
        "scale": 2000
      }
    ]
  },
  "initialExtent": {
    "xmin": -109.55,
    "ymin": 25.76,
    "xmax": -86.39,
    "ymax": 49.94,
    "spatialReference": {
      "wkid": 4326
    }
  },
  "fullExtent": {
    "xmin": -130,
    "ymin": 24,
    "xmax": -65,
    "ymax": 50,
    "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",
  "maxRecordCount": 1000,
  "maxImageHeight": 2048,
  "maxImageWidth": 2048,
  "minScale": 0,
  "maxScale": 0,
  "tileServers": ["https://myserver/arcgis/rest/services/basemap/MapServer","https://myserver2/arcgis/rest/services/basemap/MapServer"],
  "supportedQueryFormats": "JSON",
  "exportTilesAllowed": true,
  "maxExportTilesCount": 100000,
  "supportedExtensions": "FeatureServer,KmlServer,MobileServer,WCSServer,WFSServer,WMSServer,NAServer,SchematicsServer"
}

Example two

The following example demonstrates the response when requesting updated information from the service:

{
  "timeExtent": [
    1230768000000, 1243814400000
  ],
  "fullExtent": {
    "xmin": -178.21759836192689,
    "ymin": 18.924781799107389,
    "xmax": -66.969271035924393,
    "ymax": 71.406235352841463,
    "spatialReference": {
      "wkid": 4269,
      "latestWkid": 4269
    }
  }
}

Example three

The following example demonstrates the response when requesting footprint for a service:

NoteNote:

The information for imageData has been shortened for brevity.

{
  "featureCollection": {
    "layers": [
      {
        "layerDefinition":{
          "type":"Feature Layer",
          "geometryType":"esriGeometryPoint",
          "extent":{"xmin":-4254455.8606807785,"ymin":-1273247.593581636,"xmax":-3967497.083911836,"ymax":-1127922.6881048125,"spatialReference":{"wkid":102100}},          
          "objectIdField":"id",
          "displayFieldName":"Maps/BrazilMapServer",
          "drawingInfo": {
            "renderer": {
              "type":"simple",
              "label":"Maps/Brazil",
              "description":"",
              "symbol": {
                "height":24,
                "xoffset":0,
                "yoffset":0,
                "width":24,
                "contentType":"image/png",
                "type":"esriPMS",
                "imageData":"iVBORw0KGgoAAAANSUhEUgAAADQAAAA0CAYAAADFeBvrAAAABGdBTUEAALGPC/...=",
                "url":"https://sampleserver/arcgis/rest/static/images/BlueShinyPin.png"
              }
            }
          },
          "fields": [
            {
              "name": "id",
              "alias": "ID",
              "type": "esriFieldTypeOID"
            },
            {
              "name": "title",
              "alias": "Title",
              "type": "esriFieldTypeString"
            },
            {
              "name": "summary",
              "alias": "Summary",
              "type": "esriFieldTypeString"
            },
            {
              "name": "description",
              "alias": "Description",
              "type": "esriFieldTypeString"
            },
            {
              "name": "tags",
              "alias": "Tags",
              "type": "esriFieldTypeString"
            },
            {
              "name": "type",
              "alias": "Type",
              "type": "esriFieldTypeString"
            },
            {
              "name": "thumbnail",
              "alias": "Thumbnail",
              "type": "esriFieldTypeString"
            },
            {
              "name": "xmin",
              "alias": "xmin",
              "type": "esriFieldTypeDouble"
            },
            {
              "name": "ymin",
              "alias": "ymin",
              "type": "esriFieldTypeDouble"
            },
            {
              "name": "xmax",
              "alias": "xmax",
              "type": "esriFieldTypeDouble"
            },
            {
              "name": "ymax",
              "alias": "ymax",
              "type": "esriFieldTypeDouble"
            },
            {
              "name": "accessInformation",
              "alias": "Access Information",
              "type": "esriFieldTypeString"
            },
            {
              "name": "licenseInfo",
              "alias": "License Information",
              "type": "esriFieldTypeString"
            },
            {
              "name": "credits",
              "alias": "Credits",
              "type": "esriFieldTypeString"
            },
            {
              "name": "link",
              "alias": "Link",
              "type": "esriFieldTypeString"
            },
            {
              "name": "arcgisJslink",
              "alias": "ArcgisJsLink",
              "type": "esriFieldTypeString"
            }                  
          ]
        },
        "featureSet": {
          "geometryType":"esriGeometryPoint",
          "spatialReference": {
            "wkid":102100
          },
          "features": [
            {
              "geometry": {
                "x": -4110976.4722963073,
                "y": -1200585.1408432242
              },
              "attributes": {
                "id": 1,
                "title": "Maps/Brazil",
                "summary": "",
                "description": "",
                "tags": "[\"Brazil\"]",
                "type": "MapServer",
                "thumbnail": "https://sampleserver/arcgis/rest/services/Maps/Brazil/MapServer/info/thumbnail",
                "xmin": -4254455.8606807785,
                "ymin": -1273247.593581636,
                "xmax": -3967497.083911836,
                "ymax": -1127922.6881048125,
                "accessInformation": "",
                "licenseInfo": "",
                "credits": "",
                "link": "https://sampleserver/arcgis/rest/services/Maps/Brazil/MapServer",
                "arcgisJslink": "https://sampleserver/arcgis/rest/services/Maps/Brazil/MapServer?f=jsapi"
              }
            }
          ]
        },
        "popupInfo": {
          "title": "{title} ({type})",
          "fieldInfos": [
            {
              "fieldName": "id",
              "label": "ID",
              "visible": false
            },
            {
              "fieldName": "title",
              "label": "Title",
              "visible": true
            },
            {
              "fieldName": "summary",
              "label": "Summary",
              "visible": true
            },
            {
              "fieldName": "description",
              "label": "Description",
              "visible": true
            },
            {
              "fieldName": "tags",
              "label": "Tags",
              "visible": true
            },
            {
              "fieldName": "type",
              "label": "Type",
              "visible": true
            },
            {
              "fieldName": "thumbnail",
              "label": "Thumbnail",
              "visible": false
            },
            {
              "fieldName": "xmin",
              "label": "xmin",
              "format": {
                "places": 2,
                "digitSeparator":  false
              },
              "visible": false
            },
            {
              "fieldName": "ymin",
              "label": "ymin",
              "format": {
                "places": 2,
                "digitSeparator":  false
              },
              "visible": false
            },
            {
              "fieldName": "xmax",
              "label": "xmax",
              "format": {
                "places": 2,
                "digitSeparator":  false
              },
              "visible": false
            },
            {
              "fieldName": "ymax",
              "label": "ymax",
              "format": {
                "places": 2,
                "digitSeparator":  false
              },
              "visible": false
            },
            {
              "fieldName": "accessInformation",
              "label": "Access Information",
              "visible": true
            },
            {
              "fieldName": "licenseInfo",
              "label": "License Information",
              "visible": true
            },
            {
              "fieldName": "credits",
              "label": "Credits",
              "visible": true
            },
            {
              "fieldName": "link",
              "label": "Link",
              "visible": true
            }
          ],
          "description": null,
          "showAttachments": false,
          "mediaInfos": [
            {
              "type": "image",
              "caption": "Initial Extent: [{xmin}, {ymin}] - [{xmax}, {ymax}]",
              "value": {
                "sourceURL": "{thumbnail}",
                "linkURL": "{arcgisJslink}"
              }
            }
          ]
        }
      }
    ]
  }
}