ImageryTileLayer - shaded relief renderer

This sample shows how to set a RasterShadedReliefRenderer on an instance of ImageryTileLayer. RasterShadedReliefRenderer produces a grayscale or colored 3D representation of the surface on an ImageryLayer or ImageryTileLayer, with the sun's relative position taken into account for shading the image. This renderer uses the altitude and azimuth properties to specify the sun's position.

The layer in this sample contains cached global elevation data, and the controls in the top-right corner allow the user to change the renderer parameters at run-time directly on the client-side. The code below shows how to create the RasterShadedReliefRenderer and set it on the ImageryTileLayer.

Use dark colors for code blocksCopy
             
1
2
3
4
5
6
7
8
9
10
11
12
13
const renderer = new RasterShadedReliefRenderer({
  altitude: 45, // angle of elevation above the horizon
  azimuth: 315, // position along the horizon
  hillshadeType: hillshadeType, // either "traditional" or "multi-directional"
  zFactor: 1,
  scalingType: "adjusted",
  colorRamp: colorRamp
});

const layer = new ImageryTileLayer({
  url: url,
  renderer: renderer // set the renderer on the layer
});

Your browser is no longer supported. Please upgrade your browser for the best experience. See our browser deprecation post for more details.