Crater Lake National Park


Digital maps for the National Park Service

ArcGisServerRest Layer Handler

The ArcGisServerRest layer handler adds support for ArcGIS Server 9.3+ REST-based services to NPMap. This layer handler is supported by all of the base APIs.

When bringing an ArcGisServerRest layer into a map, NPMap does its best to use the configuration information defined in the service's MXD to configure the layer's behavior. So if you add an ArcGisServerRest layer to your map and see unexpected behavior, you will first want to verify that your service's MXD is configured properly.

An important sidenote: ArcGIS Server is not always the best or most efficient way to publish your data. For example, if your data are fairly static but complex you may want to consider utilizing the TileStream layer handler. If your data are simple, you may want to consider using the GeoJson or Kml layer handler. In short, there is no single solution that works well in all situations. Keep this in mind when planning your web map.

Supported Operations

  • Display
  • Edit (with edit module)
  • Identify
  • Routing (with route module)

Adding a Layer To Your Map

ArcGisServerRest layers can be added in the baseLayers or layers config in the NPMap.config object. Here are the properties that can be set on an ArcGisServerRest layer object:

Property Type Required? Description Example
edit {Object} Used in conjunction with the edit module. Not yet documented.
identify {Object} Used to customize the way data returned from an identify operation on this layer are displayed in the InfoBox. See the Customizing what is displayed in the InfoBox section of the NPMap.InfoBox documentation for information on this property.
layers {String} X A comma-delimited string of the layer numbers of the ArcGIS Server REST service you want to include in this NPMap layer. layers: '0,1'
name {String} X A name for this layer. Every layer added to NPMap via the layers config must have a unique name. name: 'National Heritage Areas'
tiled {Boolean} X Is this ArcGIS Server service tiled or dynamic? tiled: false
type {String} X The only valid value for this layer type is ArcGisServerRest. type: 'ArcGisServerRest'
url {String} X The REST endpoint for this service. This URL should always end with "/MapServer".
url: ''


Here is an example of a working layer config object:

  layers: 'all',
  name: 'National Parks',
  opacity: 0.7,
  tiled: false,
  type: 'ArcGisServerRest',
  url: ''

To see this layer config object in context within the larger NPMap.config object, take a look at the examples section.