ImageryTileLayer - shaded relief renderer

Explore in the sandboxView live

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.

             
var 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
});

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