Hide Table of Contents
esri/dijit/util
esri/layer/pixelFilters
esri/process
esri/support
esri/workers
Class: LegendLayer

require(["esri/tasks/LegendLayer"], function(LegendLayer) { /* code goes here */ });

Description

(Added at v3.0)
Define layer properties for the legend layers associated with a PrintTemplate.

Samples

Search for samples that use this class.

Constructors

NameSummary
new LegendLayer()Creates a new LegendLayer object.

Properties

NameTypeSummary
layerIdStringThe id of the operational layer to include in the printout's legend.
subLayerIdsString[]The ids of the sublayers to include in the printout's legend.
Constructor Details

new LegendLayer()

Creates a new LegendLayer object.
Sample:
require([
  "esri/tasks/LegendLayer", ... 
], function(LegendLayer, ... ) {
  var legendLayer = new LegendLayer();
  ...
});
Property Details

<String> layerId

The id of the operational layer to include in the printout's legend.
Sample:
legendLayer.layerId = "Boundaries";

<String[]> subLayerIds

The ids of the sublayers to include in the printout's legend.
Sample:
legendLayer.subLayerIds = [0, 5];
Show Modal