ActiveLayerInfo
esri/widgets/Legend/support/ActiveLayerInfo
ActiveLayerInfo is added to or removed from the collection of activeLayerInfos as layers become visible or invisible in the view. You can use this module to make the Legend more interactive.
Property Overview
Name | Type | Summary | Class | |
---|---|---|---|---|
Collection<ActiveLayerInfo> | A collection of child activeLayerInfos. more details | more details | ActiveLayerInfo | |
String | The name of the class. more details | more details | Accessor | |
Boolean | Indicates if the legend's display of the layer's renderer is driven by the scale of the view. more details | more details | ActiveLayerInfo | |
Layer | The layer represented by the ActiveLayerInfo object. more details | more details | ActiveLayerInfo | |
LegendElement[] | The legendElements is constructed using the layer Renderer. more details | more details | ActiveLayerInfo | |
ActiveLayerInfo | The ActiveLayerInfo of the parent Sublayer or GroupLayer. more details | more details | ActiveLayerInfo | |
Boolean | Indicates if the activeLayerInfo is ready. more details | more details | ActiveLayerInfo | |
Number | The scale of the view instance in which the Legend is rendered. more details | more details | ActiveLayerInfo | |
String | The text string that represents the legend's title. more details | more details | ActiveLayerInfo | |
Number | The version of the ActiveLayerInfo. more details | more details | ActiveLayerInfo | |
View | The view in which the Legend is rendered. more details | more details | ActiveLayerInfo |
Property Details
- children Collection<ActiveLayerInfo>
A collection of child activeLayerInfos. This only applies to renderers of Sublayers or the children of GroupLayers.
The name of the class. The declared class name is formatted as
esri.folder.className
.
- isScaleDriven Boolean
Indicates if the legend's display of the layer's renderer is driven by the scale of the view. This is true of Sublayer renderers, any renderer that uses a
valueExpression
(Arcade expression), DotDensityRenderer, and layers that have clustering enabled.
- layer Layer
The layer represented by the ActiveLayerInfo object.
- legendElements LegendElement[]
The legendElements is constructed using the layer Renderer. It reflects the actual structure of the legend. Each
legendElement
has the following specification:
- parent ActiveLayerInfo
The ActiveLayerInfo of the parent Sublayer or GroupLayer.
- ready Boolean
Indicates if the activeLayerInfo is ready. It is set to
true
when all its legendElements are computed. It is set tofalse
when the layer renderer changes so that the legendElements can recomputed.
- scale Number
The scale of the view instance in which the Legend is rendered.
- title String
The text string that represents the legend's title. This value is read from the
layerInfo
of the corresponding layer in the legend. If not provided, this value comes from the title of the layer.
- version Number
The version of the ActiveLayerInfo. It increases by
1
whenever ready property of ActiveLayerInfo changes. This property should watched in the view for ActiveLayerInfo changes and update the DOM accordingly.
- view View
The view in which the Legend is rendered.
Type Definitions
- ColorRampElement
Describes the schema of the ColorRampElement used as a legendElement. See the table below for more details of the properties in this object.
- Properties:
- type String
The type of this element is always
color-ramp
.The title of the color ramp as displayed in the legend.
infos ColorRampStop[]The individual color stops rendered in the legend that correspond to the color visual variable in the renderer.
- ColorRampStop
Describes the schema of the ColorRampStop element. Each ColorRampStop represents a single stop of the ColorVariable referenced in the renderer.
- Properties:
- label String
The label in the legend describing features with the given
color
andvalue
.value NumberThe value of the color visual variable stop.
color ColorThe color of the visual variable stop.
offset NumberA number between
0
and1
describing the position of the label on the color ramp. For example, in a color ramp with three stops, the first stop would have an offset of0
, the second0.5
, and the third1
. These offsets are equally spaced for any given number of labels in the color ramp. The interval of each offset value is equal to 1 divided by the number of stops minus 1.
- HeatmapRampElement
Describes the schema of the HeatmapRampElement used as a legendElement. See the table below for more details of the properties in this object.
- Properties:
- type String
The type of this element is always
heatmap-ramp
.optional The title of the heatmap ramp as displayed in the legend.
infos HeatmapRampStop[]The individual color stops rendered in the legend that correspond to the heatmap colorStops in the renderer.
- HeatmapRampStop
Describes the schema of the HeatmapRampStop element. Each HeatmapRampStop represents a single
colorStop
of the Heatmap color stops referenced in the renderer.- Properties:
- label String
The label of the color stop displayed in the legend. Typically only the first and last stops have labels.
ratio NumberThe ratio of a pixel's intensity value to the minPixelIntensity of the renderer. The ratio of each pixel is matched to the corresponding color.
color ColorThe color of the pixel corresponding to the appropriate pixel
ratio
. This value is typically between0
and1
.offset NumberA number between
0
and1
describing the position of the label on the ramp. For example, in a ramp with three stops, the first stop would have an offset of0
, the second0.5
, and the third1
. These offset values are equally spaced for any given number of labels in the ramp. The interval of each offset value is equal to 1 divided by the number of stops minus 1.
- ImageSymbolTableElementInfo
Properties defining the scheme of each of the ImageSymbolTableElementInfo. This applies only to ImageryLayer renderers.
- Properties:
- optionallabel String
The label of the category corresponding to the given image.
src StringThe data URI of the image representing a colored pixel in the renderer.
opacity NumberThe opacity of the image (
0
to1
).optionalwidth NumberThe width of the image in pixels.
optionalheight NumberThe height of the image in pixels.
- LegendElement |||||
Properties defining the scheme of each of the supported legendElements.
- OpacityRampElement
Describes the schema of the OpacityRampElement used as a legendElement. See the table below for more details of the properties in this object.
- Properties:
- type String
The type of this element is always
opacity-ramp
.optional The title of the opacity ramp as displayed in the legend.
infos OpacityRampStop[]The individual opacity stops rendered in the legend that correspond to the opacity visual variable in the renderer.
- OpacityRampStop
Describes the schema of the OpacityRampStop element. Each OpacityRampStop represents a single stop of the OpacityVariable referenced in the renderer. The opacity value of each stop is indicated in the alpha property of the
color
object.- Properties:
- label String
The label in the legend describing features with the given
color
andvalue
.value NumberThe value of the opacity visual variable stop.
color ColorThe color of the visual variable stop. The opacity corresponding to the given
value
is indicated in the alpha property of the color object.offset NumberA number between
0
and1
describing the position of the label on the ramp. For example, in a ramp with three stops, the first stop would have an offset of0
, the second0.5
, and the third1
. These offsets are equally spaced for any given number of labels in the ramp. The interval of each offset value is equal to 1 divided by the number of stops minus 1.
- RampTitle
Describes the schema of the RampTitle element.
- Properties:
- field String
The field name used in a visual variable of a renderer. This is used in the generated title of the corresponding ramp in the legend.
normField StringIf provided, the normalization field name used in a visual variable of a renderer. This is used in the generated title of the corresponding ramp in the legend.
ratio BooleanIf
true
, the legend formats to display the field and normalization field as a ratio.ratioPercent BooleanIf
true
, the legend formats to display the field and normalization field as a percentage.ratioPercentTotal BooleanIf
true
, the legend formats to display the field and normalization field as a percentage of total.
- RelationshipLabels
Describes the schema of the RelationshipLabels element. These labels are rendered in the corners of the square that represent the relationship renderer in the legend.
- Properties:
- top String
The label corresponding with the top corner of the legend if the focus is set to
HH
. This describes values that are considered high in both field 1 and field 2 (HH).bottom StringThe label corresponding with the bottom corner of the legend if the focus is set to
HH
. This describes values that are considered low in both field 1 and field 2 (LL).left StringThe label corresponding with the left corner of the legend (if the focus is set to
HH
). This describes features where the value of field 1 is high and the value of field 2 is low (HL).right StringThe label corresponding with the right corner of the legend (if the focus is set to
HH
). This describes features where the value of field 2 is high and the value of field 1 is low (LH).
- RelationshipRampElement
Describes the schema of the RelationshipRampElement used as a legendElement. See the table below for more details of the properties in this object.
- Properties:
- type String
The type of this element is always
relationship-ramp
.numClasses NumberThe number of classes for each field comprising the renderer. Can either be 2, 3, or 4.
focus StringDetermines the orientation of the Legend. Values can be
HH
,HL
,LH
,LL
.A 2-dimensional array of colors as displayed in the legend grid.
labels RelationshipLabelsThe labels for each corner of the legend.
rotation NumberThe rotation of the legend in degrees (0-360).
0
degrees displays the legend as a square with theLL
cell in the bottom left corner of the legend and theHH
cell in the top right corner.optionaltitle StringThe title of the renderer as displayed in the legend.
optional Info objects associated with the relationship renderer.
- RendererTitle
Describes the schema of the RendererTitle element.
- Properties:
- optionaltitle String
The title of the renderer as displayed in the legend.
field StringThe field name used in the renderer. This is used in the generated title of the renderer in the legend.
normField StringIf a normalization field is provided to the renderer, this field is also used in the generated title for the renderer in the legend.
normByPct BooleanIndicates if a percentage is used in the normalization of the renderer. This is used to create a more readable legend for that scenario.
- SizeRampElement
Describes the schema of the SizeRampElement used as a legendElement. See the table below for more details of the properties in this object.
- Properties:
- type String
The type of this element is always
size-ramp
.optional The title of the size ramp as displayed in the legend.
infos SizeRampStop[]The individual size stops rendered in the legend that correspond to the size visual variable in the renderer.
- SizeRampStop
Describes the schema of the SizeRampStop element. Each SizeRampStop represents a single stop of the SizeVariable referenced in the renderer.
- Properties:
- label String
The label in the legend describing features with the given
symbol
andvalue
.optionalvalue *The value of the size visual variable stop.
symbol SymbolThe symbol corresponding to the value of the stop in the renderer.
optionalsize NumberThe size of the visual variable stop in points.
optionaloutlineSize NumberThe width of the outline in points.
optionalpreview HTMLElementThe HTML element rendered in the legend representing features with the given value.
- SymbolTableElement
Describes the schema of the SymbolTableElement used as a legendElement. This legend element is used for UniqueValueRenderer and ClassBreaksRenderer. See the table below for more details of the properties in this object.
- Properties:
- type String
The type of this element is always
symbol-table
.optionaltitle String|RendererTitleThe title of the renderer as displayed in the legend.
optionallegendType StringOnly used for renderers set to ImageryLayers. Indicates the type of renderer set on the layer (e.g.
stretched
orUnique Values
).infos SymbolTableElementType[]An array of each symbol/category/break rendered for the symbol table. For example, this may be individual breaks for a ClassBreaksRenderer, or unique values for a UniqueValueRenderer.
- SymbolTableElementInfo
Properties defining the scheme of the SymbolTableElementInfo.
- Properties:
The title of the renderer as displayed in the Legend.
optionalvalue *The value corresponding with the given
symbol
in the legend.symbol SymbolThe symbol for the corresponding
value
in the legend.optionalsize NumberThe size of the symbol in points.
optionalpreview HTMLElementA preview of the symbol element as displayed in the legend.
- SymbolTableElementType |
Properties defining the scheme of each SymbolTableElementType.