import "@arcgis/map-components/components/arcgis-feature-next";- Inheritance
- ArcgisFeatureNext→
HTMLElement
- Since
- ArcGIS Maps SDK for JavaScript 5.1
The Feature (next) component is the successor to the Feature component, provided to you early for testing and feedback. In version 6.0, the implementation of arcgis-feature will be updated under the hood to that of arcgis-feature-next, and this component will be removed. To update at version 6.0, simply remove -next from the component name.
The Feature (next) component displays a graphic according to its PopupTemplate. This component is useful in instances where you want to display information about a graphic but without the use of an arcgis-popup.
To show a graphic's content with actions, related records, aggregate feature browser (clustering or binning), etc., then use the arcgis-features-next component.
When Arcade expressions that use $map or geometry functions are defined in any popup template content or as expression elements,
the map and spatialReference properties need to be defined in the Feature (next) component.
Demo
Properties
| Property | Attribute | Type |
|---|---|---|
| auto-destroy-disabled | ||
| chart-animation-disabled | ||
| default-popup-template-enabled | ||
| | ||
| readonly | | |
| heading-level | ||
| hide-attachments-content | ||
| hide-content | ||
| hide-custom-content | ||
| hide-expression-content | ||
| hide-fields-content | ||
| hide-heading | ||
| hide-last-edited-info | ||
| hide-media-content | ||
| hide-text-content | ||
| icon | ||
| readonly | | |
| label | ||
| | ||
| | ||
| | ||
| reference-element | ||
| show-relationship-content | ||
| show-utility-network-content | ||
| | ||
| readonly | | |
| time-zone | ||
| |
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
chartAnimationDisabled
- Type
- boolean
Indicates whether to disable chart animation in the component.
- Attribute
- chart-animation-disabled
- Default value
- false
defaultPopupTemplateEnabled
- Type
- boolean
Enables automatic creation of a popup template for layers that have popups enabled but no popupTemplate defined. Automatic popup templates are supported for layers that support the createPopupTemplate method.
Note: Starting with version 4.28, date fields are formatted using the short-date-short-time preset dateFormat rather than long-month-day-year in default popup created by setting the defaultPopupTemplateEnabled property to true.
For example, previously a date that may have appeared as "December 30, 1997" will now appear as "12/30/1997 6:00 PM".
- Attribute
- default-popup-template-enabled
- Default value
- false
graphic
The Graphic used to represent the feature.
- See also
- Default value
- null
- Example
- let graphic = new Graphic({geometry: view.center,attributes: {name: "Spruce",family: "Pinaceae",count: 126},symbol: new SimpleMarkerSymbol({style: "square",color: "blue",size: "8px"}),popupTemplate: {content: [{// Set popup template content}]}});
heading
- Type
- string
The title for the feature. This can be disabled by setting the hideHeading property to true.
- See also
- Default value
- null
headingLevel
- Type
- HeadingLevel
Indicates the heading level to use for the headings in the component.
- Attribute
- heading-level
- Default value
- 2
hideAttachmentsContent
- Type
- boolean
Indicates whether to hide attachments content within the component.
- Attribute
- hide-attachments-content
- Default value
- false
hideContent
- Type
- boolean
Indicates whether to hide the component's content.
- Attribute
- hide-content
- Default value
- false
hideCustomContent
- Type
- boolean
Indicates whether to hide custom content within the component.
- Attribute
- hide-custom-content
- Default value
- false
hideExpressionContent
- Type
- boolean
Indicates whether to hide expression content within the component.
- Attribute
- hide-expression-content
- Default value
- false
hideFieldsContent
- Type
- boolean
Indicates whether to hide fields content within the component.
- Attribute
- hide-fields-content
- Default value
- false
hideLastEditedInfo
- Type
- boolean
Indicates whether to hide the last edited info in the component.
- Attribute
- hide-last-edited-info
- Default value
- false
hideMediaContent
- Type
- boolean
Indicates whether to hide media content within the component.
- Attribute
- hide-media-content
- Default value
- false
hideTextContent
- Type
- boolean
Indicates whether to hide text content within the component.
- Attribute
- hide-text-content
- Default value
- false
isFeatureFromTable
- Type
- boolean
Indicates whether the current graphic resides in a non-spatial table.
- Default value
- false
location
The Point representing the location of the map interaction used to trigger the opening of the component.
- Example
- view.on("click", (event) => {const { mapPoint } = event;feature.viewModel.location = mapPoint;});
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. Without a map, expressions that use $map will throw an error.
- Default value
- null
- Example
- // The building footprints represent the buildings that intersect a clicked parcellet buildingFootprints = Intersects($feature, FeatureSetByName($map, "Building Footprints"));
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
showRelationshipContent
- Type
- boolean
This property provides the ability to hide or show relationship content within the component.
- Attribute
- show-relationship-content
- Default value
- false
showUtilityNetworkContent
- Type
- boolean
This property provides the ability to hide or show utility network content within the component.
- Attribute
- show-utility-network-content
- Default value
- false
spatialReference
- Type
- SpatialReference | null | undefined
The spatial reference used for Arcade operations. This property should be set if the component executes Arcade expressions that contain geometry functions.
- Default value
- null
timeZone
- Type
- string
Dates and times displayed in the component will be displayed in this time zone. By default this time zone is
inherited from MapView.timeZone. When a MapView is not associated with the component,
then the property will fallback to the system time zone.
Possible Values
system: Dates and times will be displayed in the timezone of the device or browser.unknown: Dates and time are not adjusted for any timezone.- Specified IANA timezone: Dates and times will be displayed in the specified IANA time zone. See wikipedia - List of tz database time zones.
- Attribute
- time-zone
view
- Type
- MapViewOrSceneView | null | undefined
The view associated with the component.
Note: The recommended approach is to fully migrate applications to use map and scene components and avoid using MapView and SceneView directly. However, if you are migrating a large application from widgets to components, you might prefer a more gradual transition. To support this use case, the SDK includes this
viewproperty which connects a component to a MapView or SceneView. Ultimately, once migration is complete, the arcgis-feature-next component will be associated with a map or scene component rather than using theviewproperty.
Methods
| Method | Signature |
|---|---|
| inherited | componentOnReady(): Promise<this> |
| destroy(): Promise<void> | |
| nextMedia(contentElementIndex: number): void | |
| previousMedia(contentElementIndex: number): void | |
| setActiveMedia(contentElementIndex: number, mediaInfoIndex: number): void | |
| updateGeometry(): Promise<void> |
componentOnReady
- Signature
-
componentOnReady (): Promise<this>
Creates a promise that resolves once the component is fully loaded.
- Returns
- Promise<this>
- Example
- const arcgisFeatureNext = document.createElement("arcgis-feature-next");document.body.append(arcgisFeatureNext);await arcgisFeatureNext.componentOnReady();console.log("arcgis-feature-next is ready to go!");
setActiveMedia
- Signature
-
setActiveMedia (contentElementIndex: number, mediaInfoIndex: number): void
Events
| Name | Type |
|---|---|
| CustomEvent<{ name: "flowItems" | "state"; }> | |
arcgisPropertyChange
arcgisPropertyChange: CustomEvent<{ name: "flowItems" | "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.