Can I use elevation service as a layer in the basemap

469
1
Jump to solution
01-26-2021 09:24 AM
by Anonymous User
Not applicable

Hi Friends,

I am trying to use https://elevation.arcgis.com/arcgis/rest/services/WorldElevation/Terrain/ImageServer as a layer in the basemap using the below code

require([
"esri/Map",
"esri/views/MapView",
"esri/Basemap",
"esri/layers/MapImageLayer",
"esri/layers/TileLayer",
"esri/layers/ElevationLayer"
], function (Map, MapView, Basemap, MapImageLayer, TileLayer,ElevationLayer) {
var map = new Map({
basemap: new Basemap({
baseLayers: [
new ElevationLayer({
url:
"https://elevation.arcgis.com/arcgis/rest/services/WorldElevation/Terrain/ImageServer"
})
],
title: "basemap",
id: "basemap"
})
});

 

The above is not working and I get the below error in the console

Failed to create layerview for layer title:'Terrain', id:'1773f92f405-layer-0' of type 'elevation'

 

Any help on how to get this to work is much appreciated

0 Kudos
1 Solution

Accepted Solutions
KenBuja
MVP Honored Contributor

You have to use a tiled layer in an ElevationLayer. The specific service you want to use is not a tiled layer.

View solution in original post

0 Kudos
1 Reply
KenBuja
MVP Honored Contributor

You have to use a tiled layer in an ElevationLayer. The specific service you want to use is not a tiled layer.

0 Kudos