import "@arcgis/map-components/components/arcgis-feature-templates-legacy";- Inheritance:
- ArcgisFeatureTemplatesLegacy→
PublicLitElement
- Since
- ArcGIS Maps SDK for JavaScript 5.0
This is a legacy component. It relies on an underlying widget as part of our migration to native web components.
A fully native replacement for this component is in development. Once it reaches feature parity, the legacy component will be deprecated and no longer maintained. At that point, development should use the native component.
The FeatureTemplates component is part of an editing workflow. Its main purpose is to display FeatureLayer templates from one or more feature layers.
Properties
| Property | Attribute | Type |
|---|---|---|
auto-destroy-disabled | ||
| ||
filter-text | ||
heading-level | ||
hide-filter | ||
icon | Icon["icon"] | |
items readonly | | |
label | ||
reference-element | ||
selectedItem readonly | | |
selection-mode | ||
state readonly | | |
|
autoDestroyDisabled
- Type
- boolean
If true, the component will not be destroyed automatically when it is disconnected from the document. This is useful when you want to move the component to a different place on the page, or temporarily hide it. If this is set, make sure to call the destroy() method when you are done to prevent memory leaks.
- Attribute
- auto-destroy-disabled
- Default value
- false
disabledItemFunction
- Type
- DisabledItemFunction
A function that can be defined to disable specific
template items
within the component. The function takes an object containing a
layer
and template. If the function returns true, the item is disabled.
headingLevel
- Type
- HeadingLevel
- Since
- ArcGIS Maps SDK for JavaScript 4.20
Indicates the heading level to use for the labels of grouped feature templates.
By default, the group label is rendered
as a level 4 heading (e.g. <h4>Group label</h4>). Depending on the component's placement
in your app, you may need to adjust this heading for proper semantics. This is
important for meeting accessibility standards.
- See also
- Attribute
- heading-level
- Default value
- 4
Example
// Group label will render as an <h3>featureTemplates.headingLevel = 3; hideFilter
- Type
- boolean
Indicates whether the templates filter displays.
- Attribute
- hide-filter
- Default value
- false
icon
- Type
- Icon["icon"]
Icon which represents the component. Typically used when the component is controlled by another component (e.g. by the Expand component).
- See also
- Attribute
- icon
- Default value
- "list-rectangle"
referenceElement
- Type
- ArcgisReferenceElement | string | undefined
By assigning the id attribute of the Map or Scene component to this property, you can position a child component anywhere in the DOM while still maintaining a connection to the Map or Scene.
- Attribute
- reference-element
Methods
| Method | Signature |
|---|---|
componentOnReady inherited | componentOnReady(): Promise<this> |
destroy(): Promise<void> | |
select(item: null | undefined | TemplateItem): void |
componentOnReady
- Signature
-
componentOnReady (): Promise<this>
Creates a promise that resolves once the component is fully loaded.
- Returns
- Promise<this>
Example
const arcgisFeatureTemplatesLegacy = document.querySelector("arcgis-feature-templates-legacy");document.body.append(arcgisFeatureTemplatesLegacy);await arcgisFeatureTemplatesLegacy.componentOnReady();console.log("arcgis-feature-templates-legacy is ready to go!"); select
- Signature
-
select (item: null | undefined | TemplateItem): void
Selects the template item to use.
Parameters
| Parameter | Type | Description | Required |
|---|---|---|---|
| item | The template item to select. | |
- Returns
- void
Events
| Name | Type |
|---|---|
| CustomEvent<{ name: "state"; }> | |
arcgisPropertyChange
arcgisPropertyChange: CustomEvent<{ name: "state"; }> Emitted when the value of a property is changed. Use this to listen to changes to properties.
arcgisReady
arcgisReady: CustomEvent<void> Emitted when the component associated with a map or scene view is ready to be interacted with.
Type definitions
DisabledItemFunction
Parameters
| Parameter | Type | Description | Required |
|---|---|---|---|
| params | Pick<TemplateItem, "layer" | "template"> | | |
- Returns
- boolean