You are using a browser that is no longer supported. Please use the latest version of Google Chrome, Mozilla Firefox, Apple Safari, or Microsoft Edge. For more information please see the System Requirements.
Skip To ContentArcGIS for DevelopersSign In Dashboard

Note: Support for 3D on mobile devices may vary, view the system requirements for more information.

This sample demonstrates how to create a sublayer in a MapImageLayer from a raster located in a registered workspace.

var layer = new MapImageLayer({
  url: "",
  sublayers: [
      title: "Slope",
      source: {
        type: "data-layer",
        dataSource: {
          type: "raster",
          workspaceId: "MyDatabaseWorkspaceIDSSR2",
          dataSourceName: "slope"

This app contains two raster sublayers in Glacier Bay National Park, Alaska. One is a hillshade and the other is a digital elevation model (DEM) created by the USGS in May 2016. The DEM has a resolution of five meters and was was used to create the hillshade. Move the slider to observe the satellite imagery below the hillshade. Comparing the image against the detailed hillshade allows you to observe how some glaciers in the area may have receded since the satellite image was taken.

Sample search results