Add Layer

Add a layer to the table of contents, basemap, or terrain of ArcGIS Earth, and return the layer ID and its load status info.

Request URL

<baseUrl>/arcgisearth/layer(POST only)

Request parameters

ParameterDescription

URI (URIs)

(required)

Specifies the URL or path of a layer.

Type: string

target

(optional)

Specifies the target place where the layers are added. If not specified, the default value is operationalLayers.

Values:

  • operationalLayers—Layers added to the table of contents
  • baseMaps—Layers added to the basemap
  • elevationLayers—Layers added to the terrain

Type: string

type

(optional)

Specifies the data type supported in ArcGIS Earth.

Value:

  • ArcGISFeatureService—ArcGIS feature service
  • ArcGISMapService—ArcGIS map service
  • ArcGISImageService—ArcGIS image service
  • Shapefile—Local shapefile
  • WMS—OGC Web Map Service
  • KML—KML and KMZ
  • SceneLayerPackage—ArcGIS scene layer package
  • SceneService—ArcGIS scene service
  • RasterDataLayer—Local elevation raster formats
  • TilePackage—ArcGIS tile package
  • ArcGISMobileScenePackage— ArcGIS mobile scene package
  • ArcGISWebScene—ArcGIS web scene
  • ArcGISWebMap—ArcGIS web map
  • PortalItem—ArcGIS portal item, includes ArcGIS web scene, ArcGIS web map, and ArcGIS REST services
  • GeoJSON—GeoJSON
  • GPX—GPX

Type: string

Note:

  • When adding a layer with a token, you need to specify ?token=<your-token> for URI.
  • When adding a WMS layer, you need to specify the WMS value for the type.
  • Use URIs when you want to add multiple elevation files as ElevationLayers.

Supported types for the target are as follows:

ValueOperationalLayersBasemapLayersElevationLayers
ArcGISFeatureService
ArcGISMapService
ArcGISImageService
Shapefile
WMS
KML
SceneLayerPackage
SceneService
RasterDataLayer
TilePackage
PortalItem
GeoJSON
GPX
Note:
  • Only elevation image services and tile packages with LERC tile format can be added as elevation layers in ArcGIS Earth.
  • When adding an ArcGIS mobile scene package, ArcGIS web scene, or ArcGIS web map, there is no need to specify the target.
  • If the portal item is an ArcGIS web scene or ArcGIS web map, there is no need to specify the target.

Example usage

A sample input for adding an ArcGIS portal item (web scene) is as follows:

{
    "URI": "https://www.arcgis.com/home/item.html?id=19dcff93eeb64f208d09d328656dd492",
    "target": "operationalLayers",
    "type": "PortalItem"
}

For a sample input for adding an OGC Web Map Service, you need to specify the type value:

{
    "URI": "http://ogc.bgs.ac.uk/cgi-bin/BGS_Bedrock_and_Superficial_Geology/wms?SERVICE=WMS&REQUEST=GetCapabilities",
    "target": "baseMaps",
    "type": "WMS"
}

For a sample input for adding multiple elevation files as elevationLayers, you need to use URIs:

{
    "URIs": [
        "C:\\test1.dt1",
        "C:\\test2.dt1"
    ],
    "target": "elevationLayers",
    "type": "RasterDataLayer"
}

JSON Response example

Below is a JSON response example for adding an ArcGIS portal item (web scene):

{
    "displayName": "Visualize New Developments",
    "isVisible": true,
    "classType": "ArcGISScene",
    "id": "311b7317-94f8-4f80-89f2-0e3ca5e77d28",
    "sourceURI": "https://www.arcgis.com/sharing/rest/content/items/19dcff93eeb64f208d09d328656dd492",
    "loadStatus": "Loaded"
}

Below is a JSON response example for adding an OGC Web Map Service:

{
    "id": "cb689cd9-0957-4fde-9b63-634d4287864e",
    "opacity": 1.0,
    "displayName": "BGS Bedrock and Superficial geology",
    "isVisible": true,
    "classType": "WMS_Layer",
    "sourceURI": "http://ogc.bgs.ac.uk/cgi-bin/BGS_Bedrock_and_Superficial_Geology/wms?SERVICE=WMS&REQUEST=GetCapabilities",
    "brightness": 0.0,
    "contrast": 0.0,
    "gamma": 0.0,
    "loadStatus": "Loaded"
}

Below is a JSON response example for adding an ArcGIS map service:

{
    "classType": "Raster_Elevation_Source",
    "displayName": "test1.dt1,test2.dt1",
    "isEnabled": true,
    "thumbnailUri": "",
    "id": "0841c791-d01d-4d69-a0bf-ed49801b5449",
    "fileNames": [
        "C\\test1.dt1",
        "C\\test2.dt1"
    ],
    "loadStatus": "Loaded"
}