Feature

1
import "@arcgis/map-components/components/arcgis-feature";

Feature component displays a graphic according to its PopupTemplate. This component is useful in instances where you want to display information about a feature but without the use of a Popup.

Demo

Properties

PropertyAttributeType
auto-destroy-disabled
boolean
default-popup-template-enabled
boolean
heading-level
number
hide-content-attachments
boolean
hide-content-expression
boolean
hide-content-fields
boolean
hide-content-media
boolean
hide-content-text
boolean
hide-last-edit-info
boolean
hide-title
boolean
icon
string
label
string
position
"bottom-leading" | "bottom-left" | "bottom-right" | "bottom-trailing" | "manual" | "top-leading" | "top-left" | "top-right" | "top-trailing"
reference-element
ArcgisLinkChart | ArcgisMap | ArcgisScene | string
state
readonly
state
"disabled" | "error" | "loading" | "ready"

autoDestroyDisabled

Property
autoDestroyDisabled: 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

defaultPopupTemplateEnabled

Property
defaultPopupTemplateEnabled: boolean

Enables automatic creation of a popup template for layers that have popups enabled but no popupTemplate defined.

Read more...

Attribute
default-popup-template-enabled
Default value
false

graphic

Property
graphic: Graphic

The Graphic used to represent the feature.

Read more...

Default value
null

headingLevel

Property
headingLevel: number

Indicates the heading level to use for the title of the feature widget.

Read more...

Attribute
heading-level
Default value
2

hideContentAttachments

Property
hideContentAttachments: boolean
Attribute
hide-content-attachments
Default value
false

hideContentExpression

Property
hideContentExpression: boolean
Attribute
hide-content-expression
Default value
false

hideContentFields

Property
hideContentFields: boolean
Attribute
hide-content-fields
Default value
false

hideContentMedia

Property
hideContentMedia: boolean
Attribute
hide-content-media
Default value
false

hideContentText

Property
hideContentText: boolean
Attribute
hide-content-text
Default value
false

hideLastEditInfo

Property
hideLastEditInfo: boolean
Attribute
hide-last-edit-info
Default value
false

hideTitle

Property
hideTitle: boolean
Attribute
hide-title
Default value
false

icon

Property
icon: string

Icon which represents the component. Typically used when the component is controlled by another component (e.g. by the Expand component). Search Calcite Icons for possible values.

Attribute
icon
Default value
"polygon"

label

Property
label: string

The component's default label.

Attribute
label

location

Property
location: Point

The Point representing the location of the MapView interaction used to trigger the opening of the widget.

Read more...

Default value
null

map

Property
map: Map

A map is required when the input graphic has a popupTemplate that contains Arcade expressions in ExpressionInfo or ExpressionContent that may use the $map profile variable to access data from layers within a map.

Read more...

Default value
null

position

Property
position: "bottom-leading" | "bottom-left" | "bottom-right" | "bottom-trailing" | "manual" | "top-leading" | "top-left" | "top-right" | "top-trailing"
Attribute
position
Default value
"bottom-left"

referenceElement

Property
referenceElement: ArcgisLinkChart | ArcgisMap | ArcgisScene | string
Attribute
reference-element

spatialReference

Property
spatialReference: SpatialReference

The spatial reference used for Arcade operations.

Read more...

Default value
null

state

readonly
Property
state: "disabled" | "error" | "loading" | "ready"

The view model's state.

Read more...

Attribute
state
Default value
"disabled"

Methods

MethodSignature
componentOnReady(): Promise<void>
destroy(): Promise<void>
nextMedia(contentElementIndex: number): Promise<void>
previousMedia(contentElementIndex: number): Promise<void>
setActiveMedia(contentElementIndex: number, mediaInfoIndex: number): Promise<void>

componentOnReady

Method
componentOnReady(): Promise<void>

Create a promise that resolves once component is fully loaded.

Returns
Promise<void>

destroy

Method
destroy(): Promise<void>

Permanently destroy the component

Returns
Promise<void>

nextMedia

Method
nextMedia(contentElementIndex: number): Promise<void>
Parameters
ParameterTypeOptional?
contentElementIndex
number
Returns
Promise<void>

previousMedia

Method
previousMedia(contentElementIndex: number): Promise<void>
Parameters
ParameterTypeOptional?
contentElementIndex
number
Returns
Promise<void>

setActiveMedia

Method
setActiveMedia(contentElementIndex: number, mediaInfoIndex: number): Promise<void>
Parameters
ParameterTypeOptional?
contentElementIndex
number
mediaInfoIndex
number
Returns
Promise<void>

Events

EventType
{ name: "state"; }
undefined

arcgisPropertyChange

Event
arcgisPropertyChange: { name: "state"; }

Fired when the value of a property is changed. Use this to listen to changes to properties.

arcgisReady

Event
arcgisReady: undefined

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

You can no longer sign into this site. Go to your ArcGIS portal or the ArcGIS Location Platform dashboard to perform management tasks.

Your ArcGIS portal

Create, manage, and access API keys and OAuth 2.0 developer credentials, hosted layers, and data services.

Your ArcGIS Location Platform dashboard

Manage billing, monitor service usage, and access additional resources.

Learn more about these changes in the What's new in Esri Developers June 2024 blog post.

Close