import "@arcgis/map-components/components/arcgis-popup";Overview
The Popup component allows users to view content from feature attributes. Popups enhance web applications by providing users with a simple way to interact with and view attributes in a layer. They play an important role in relaying information to the user, which improves the storytelling capabilities of the application.
The arcgis-map, arcgis-scene, and arcgis-link-chart components currently use the Popup widget by default.
To use the Popup component, add it to the arcgis-map.popup, arcgis-scene.popup, or arcgis-link-chart.popup component using the popup slot.
The Popup component will be opened automatically to display the selected feature's popup template when features in the Map, Scene, or Link Chart are clicked.
<arcgis-map id="06ca49d0ddb447e7817cfc343ca30df9">
<!-- Add the popup component to the popup slot. -->
<arcgis-popup slot="popup"></arcgis-popup>
</arcgis-map>The Popup component can also be opened manually at a specific location with custom content specified in the method parameters using the open() method.
To prevent the popup from opening automatically when clicking on features within view components, set the popup-disabled attribute to true.
<!-- Set popup-disabled attribute -->
<arcgis-map id="06ca49d0ddb447e7817cfc343ca30df9" popup-disabled>
<!-- Add the popup component to the popup slot. -->
<arcgis-popup slot="popup"></arcgis-popup>
</arcgis-map>
<script>
const viewElement = document.querySelector("arcgis-map");
const popupComponent = document.querySelector("arcgis-popup");
// Listen for clicks on the view and open the popup at the clicked location with custom content.
viewElement.addEventListener("arcgisViewClick", (event) => {
const { mapPoint } = event.detail;
popupComponent.open({
location: mapPoint,
heading: "You clicked here",
content: "Latitude: " + mapPoint.latitude.toFixed(3) + ", Longitude: " + mapPoint.longitude.toFixed(3)
});
});
</script>Popup UI
The arcgis-map, arcgis-scene, or arcgis-link-chart components contain a default popup. This popup can display generic content, which is set in its heading and content properties. When content is set directly on the Popup instance it is not tied to a specific feature or layer.

In the image above, the text "Marriage in Nassau County Census Tract 5177.01" is the popup's heading. The remaining text is the popup's content. A dock button is displayed in the top right corner of the popup allowing the user to dock the popup to one of the sides or corners of the view. The options for docking may be set in the dockOptions property. The popup may also be collapsed by clicking the collapse button (the down arrow icon) in the top right corner of the popup. When collapsed, only the heading of the popup displays. The popup may be closed by clicking the close button (the "x" icon) in the top right corner of the popup.
Popups can also contain actions which execute a function defined by the developer when clicked. By default, every popup has a "Zoom to" action (as shown in the image above with the magnifying glass) that allows users to zoom to the selected feature. See the actions property for information about adding custom actions to a popup.
The Popup component is tied to a arcgis-map, arcgis-scene, or arcgis-link-chart component, whether it's docked or anchored to the selected feature. If wanting to utilize the Popup functionality outside of arcgis-map, arcgis-scene, or arcgis-link-chart, the arcgis-features component can be used to display the same content in its own container.
Popup and PopupTemplate
PopupTemplates are closely related to Popup, but are more specific to layers and graphics. Popup templates allow you to define custom titles and content templates based on the source of the selected feature. When a layer or a graphic has a defined popup template, the popup will display the content defined in the popup template when the feature is clicked. The content may contain field values from the attributes of the selected feature.
Custom PopupTemplates may also be assigned directly to a popup by setting graphics on the features property.
- See also
Demos
The Popup component opens on view element click.
The Popup component opens manually within a click event.
Properties
| Property | Attribute | Type |
|---|---|---|
actions | | Collection<ActionButton | ActionToggle> |
activereadonly | | boolean |
alignment | alignment | "auto" | "bottom-center" | "bottom-end" | "bottom-left" | "bottom-right" | "bottom-start" | "top-center" | "top-end" | "top-left" | "top-right" | "top-start" | ((() => PopupPositionValue)) |
autoCloseEnabled | auto-close-enabled | boolean |
autoDestroyDisabled | auto-destroy-disabled | boolean |
collapsedreadonly | | boolean |
content | content | HTMLElement | Widget | string |
currentDockPositionreadonly | | "bottom-center" | "bottom-left" | "bottom-right" | "top-center" | "top-left" | "top-right" |
defaultPopupTemplateEnabled | default-popup-template-enabled | boolean |
dockEnabled | dock-enabled | boolean |
dockOptions | | DockOptions |
featureCountreadonly | | number |
featureMenuOpen | feature-menu-open | boolean |
features | | Array<Graphic> |
goToOverride | | (((view: MapView | SceneView, goToParameters: GoToParameters) => void)) |
heading | heading | string |
headingLevel | heading-level | 1 | 2 | 3 | 4 | 5 | 6 |
hideActionBar | hide-action-bar | boolean |
hideCloseButton | hide-close-button | boolean |
hideCollapseButton | hide-collapse-button | boolean |
hideFeatureListLayerTitle | hide-feature-list-layer-title | boolean |
hideFeatureMenuHeading | hide-feature-menu-heading | boolean |
hideFeatureNavigation | hide-feature-navigation | boolean |
hideHeading | hide-heading | boolean |
hideSpinner | hide-spinner | boolean |
highlightDisabled | highlight-disabled | boolean |
includeDefaultActionsDisabled | include-default-actions-disabled | boolean |
initialDisplayMode | initial-display-mode | "feature" | "list" |
label | label | string |
location | | Point |
messageOverrides | | Record<string, unknown> |
promises | | Array<Promise<Array<Graphic>>> |
referenceElement | reference-element | HTMLArcgisLinkChartElement | HTMLArcgisMapElement | HTMLArcgisSceneElement | string |
selectedDrillInFeaturereadonly | | Graphic |
selectedFeaturereadonly | | Graphic |
selectedFeatureComponentreadonly | | HTMLArcgisFeatureElement |
selectedFeatureIndex | selected-feature-index | number |
statereadonlyreflected | state | "disabled" | "ready" |
view | | MapView | SceneView |
visible | visible | boolean |
actions
actions: Collection<ActionButton | ActionToggle>A collection of action button or action toggle objects. Each action may be executed by clicking the icon or image symbolizing them.
By default, popups have a Zoom To action styled with a magnifying glass icon.
When this icon is clicked, the view zooms in four LODs and centers on the selected feature.
You may remove this default action by setting includeDefaultActionsDisabled to true, or by setting the
overwriteActions property to true in a PopupTemplate.
The order of each action is the order in which they appear in the actions Collection.
The arcgisTriggerAction event fires each time an action is clicked.
- See also
Example
// Defines an action button to zoom out from the selected feature
const zoomOutAction = {
type: "button",
// This text is displayed as a tooltip
title: "Zoom out",
// The ID by which to reference the action in the event handler
id: "zoom-out",
// Sets the icon used to style the action button
icon: "magnifying-glass-minus"
};
// Adds the custom action to the popup.
popupComponent.actions.push(zoomOutAction);active
active: booleanIndicates if the component is active when it is visible and is not waiting.
- Default value
- false
alignment
alignment: "auto" | "bottom-center" | "bottom-end" | "bottom-left" | "bottom-right" | "bottom-start" | "top-center" | "top-end" | "top-left" | "top-right" | "top-start" | ((() => PopupPositionValue))Position of the popup in relation to the selected feature. The default behavior
is to display above the feature and adjust if not enough room. If needing
to explicitly control where the popup displays in relation to the feature, choose
an option besides auto.
Example
// Popup will display on the bottom-right of the selected feature regardless of where that feature is located
popupComponent.alignment = "bottom-right";- Attribute
- alignment
- Default value
- "auto"
autoCloseEnabled
autoCloseEnabled: booleanThis closes the popup when the View camera or Viewpoint changes.
- Attribute
- auto-close-enabled
- Default value
- false
autoDestroyDisabled
autoDestroyDisabled: booleanIf 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
collapsed
collapsed: booleanIndicates whether the popup displays its content. If true, only the header displays.
- Default value
- false
content
content: HTMLElement | Widget | stringThe content of the popup. When set directly on the Popup, this content is static and cannot use fields to set content templates. To set a template for the content based on field or attribute names, see PopupTemplate.content.
Example
// This sets generic instructions in the popup that will always be displayed
// unless it is overridden by a PopupTemplate
popupComponent.content = "Click a feature on the map to view its attributes";- Attribute
- content
currentDockPosition
currentDockPosition: "bottom-center" | "bottom-left" | "bottom-right" | "top-center" | "top-left" | "top-right"Dock position in the arcgis-map, arcgis-scene, or arcgis-link-chart component.
defaultPopupTemplateEnabled
defaultPopupTemplateEnabled: booleanEnables 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. (Supported for
FeatureLayer,
GeoJSONLayer,
OGCFeatureLayer,
SceneLayer,
CSVLayer,
PointCloudLayer,
StreamLayer,
ImageryLayer, and
VoxelLayer).
Note:
- Starting with version 4.12, PopupTemplate content can no longer be set using a
wildcard, e.g.
*. Instead, set thedefaultPopupTemplateEnabledproperty totrue. - Starting with 4.16, the default popup has been improved to no longer display system
fields
that do not hold significant value, e.g.
Shape__AreaandShape__Lengthare two fields that no longer display. - Starting with version 4.28,
datefields are formatted using theshort-date-short-timepreset dateFormat rather thanlong-month-day-yearin default popup created by setting thedefaultPopupTemplateEnabledproperty totrue. 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
dockEnabled
dockEnabled: booleanIndicates whether the placement of the popup is docked to the side of the view.
Docking the popup allows for a better user experience, particularly when opening popups in apps on mobile devices. When a popup is "dockEnabled" it means the popup no longer points to the selected feature or the location assigned to it. Rather it is attached to a side, the top, or the bottom of the view.
See dockOptions to override default options related to docking the popup.
Examples
<!-- Setting this property in HTML -->
<arcgis-popup dock-enabled></arcgis-popup>// Setting this property using JS.
// The popup will automatically be dockEnabled when made visible
popupComponent.dockEnabled = true;- Attribute
- dock-enabled
- Default value
- false
dockOptions
dockOptions: DockOptionsDocking the popup allows for a better user experience, particularly when opening popups in apps on mobile devices. When a popup is "dockEnabled" it means the popup no longer points to the selected feature or the location assigned to it. Rather it is placed in one of the corners of the view or to the top or bottom of it. This property allows the developer to set various options for docking the popup.
See the object specification table below to override default docking properties on the popup.
Example
popupComponent.dockOptions = {
// Disable the dock button so users cannot undock the popup
buttonEnabled: false,
// Dock the popup when the size of the view is less than or equal to 600x1000 pixels
breakpoint: {
width: 600,
height: 1000
}
};featureCount
featureCount: numberThe number of selected features available to the popup.
- Default value
- 0
featureMenuOpen
featureMenuOpen: booleanThis property enables showing a list of features.
Setting this to true allows the user to scroll through the list of features.
This value will only be honored if initialDisplayMode is set to "feature".
- Attribute
- feature-menu-open
- Default value
- false
features
features: Array<Graphic>An array of features associated with the popup. Each graphic in this array must
have a valid PopupTemplate set. They may share the same
PopupTemplate or have unique
PopupTemplates depending on their attributes.
The content and title
of the popup is set based on the content and title properties of each graphic's respective
PopupTemplate.
When more than one graphic exists in this array, the current content of the Popup is set based on the value of the selected feature.
This value is null if no features are associated with the popup.
Example
// When setting the features property, the graphics pushed to this property
// must have a PopupTemplate set.
let g1 = new Graphic();
g1.popupTemplate = new PopupTemplate({
title: "Results title",
content: "Results: {ATTRIBUTE_NAME}"
});
// Set the graphics as an array to the popup instance. The content and title of
// the popup will be set depending on the PopupTemplate of the graphics.
// Each graphic may share the same PopupTemplate or have a unique PopupTemplate
let graphics = [g1, g2, g3, g4, g5];
popupComponent.features = graphics;goToOverride
goToOverride: (((view: MapView | SceneView, goToParameters: GoToParameters) => void))This function provides the ability to override either the arcgis-map.goTo or arcgis-scene.goTo methods.
Example
popupComponent.goToOverride = (viewElement, goToParams)=> {
goToParams.options = {
speedFactor: 2
};
return viewElement.goTo(goToParams.target, goToParams.options);
};heading
heading: stringThe title of the popup. This can be set generically on the popup no matter the features that are selected. If the selected feature has a PopupTemplate, then the title set in the corresponding template is used here.
- See also
Examples
<!-- This title will display in the popup unless a selected feature's
PopupTemplate overrides it -->
<arcgis-popup heading="Population by zip codes in Southern California"></arcgis-popup>// This title will display in the popup unless a selected feature's
// PopupTemplate overrides it
popupComponent.title = "Population by zip codes in Southern California";- Attribute
- heading
headingLevel
headingLevel: 1 | 2 | 3 | 4 | 5 | 6Indicates the heading level to use for the heading of the popup.
By default, the heading is rendered
as a level 2 heading (e.g. <h2>Popup title</h2>). 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
Example
<!-- Render the popup heading as a level 3 heading -->
<arcgis-popup heading="Popup title" heading-level="3"></arcgis-popup>- Attribute
- heading-level
- Default value
- 2
hideActionBar
hideActionBar: booleanIndicates whether to hide the action bar that holds the feature's actions.
- Attribute
- hide-action-bar
- Default value
- false
hideCloseButton
hideCloseButton: booleanIndicates whether to hide the close button in the component.
- Attribute
- hide-close-button
- Default value
- false
hideCollapseButton
hideCollapseButton: booleanIndicates whether to hide the collapse button in the component.
- Attribute
- hide-collapse-button
- Default value
- false
hideFeatureListLayerTitle
hideFeatureListLayerTitle: booleanIndicates whether to hide the group heading for a list of multiple features in the feature menu.
- Attribute
- hide-feature-list-layer-title
- Default value
- false
hideFeatureMenuHeading
hideFeatureMenuHeading: booleanIndicates whether to hide a heading and description on the component feature menu list.
- Attribute
- hide-feature-menu-heading
- Default value
- false
hideFeatureNavigation
hideFeatureNavigation: booleanIndicates whether pagination for feature navigation will be displayed. This allows the user to scroll through various selected features using pagination arrows.
- Attribute
- hide-feature-navigation
- Default value
- false
hideHeading
hideHeading: booleanIndicates whether to hide the heading in the component.
- Attribute
- hide-heading
- Default value
- false
hideSpinner
hideSpinner: booleanIndicates whether to hide the spinner in the component.
- Attribute
- hide-spinner
- Default value
- false
highlightDisabled
highlightDisabled: booleanIndicates if the selected feature will be highlighted. This is done using the arcgis-map.highlights or the arcgis-scene.highlights.
- Attribute
- highlight-disabled
- Default value
- false
includeDefaultActionsDisabled
includeDefaultActionsDisabled: booleanIndicates whether to include the default actions in the component.
In order to disable any default actions, it is necessary to set includeDefaultActionsDisabled to true.
- Attribute
- include-default-actions-disabled
- Default value
- false
initialDisplayMode
initialDisplayMode: "feature" | "list"Indicates whether to initially display a list of features, or the content for one feature.
- Attribute
- initial-display-mode
- Default value
- "feature"
location
location: PointPoint used to position the popup. This is automatically set when viewing the popup by selecting a feature. If using the Popup to display content not related to features in the map, such as the results from a task, then you must set this property before making the popup visible to the user.
Examples
// Sets the location of the popup to the center of the view
popupComponent.location = viewELement.center;
// Displays the popup
popupComponent.visible = true;// Sets the location of the popup to a specific place (using autocast)
// Note: using latitude/longitude only works if view is in Web Mercator or WGS84 spatial reference.
popupComponent.location = {latitude: 34.0571, longitude: -117.1968};// Sets the location of the popup to the location of a click on the view
reactiveUtils.on(()=>viewElement, "arcgisViewClick", (event)=>{
popupComponent.location = event.detail.mapPoint;
// Displays the popup
popupComponent.visible = true;
});messageOverrides
messageOverrides: Record<string, unknown>Overwrite localized strings for this component
promises
promises: Array<Promise<Array<Graphic>>>An array of pending Promises that have not yet been fulfilled. If there are
no pending promises, the value is null. When the pending promises are
resolved they are removed from this array and the features they return
are pushed into the features array.
referenceElement
referenceElement: HTMLArcgisLinkChartElement | HTMLArcgisMapElement | HTMLArcgisSceneElement | stringBy 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
selectedDrillInFeature
selectedDrillInFeature: GraphicThe feature that the component has drilled into. This feature is either associated with the selected feature in a relationship or utility network element.
selectedFeature
selectedFeature: GraphicThe selected feature accessed by the popup. The content of the Popup is determined based on the PopupTemplate assigned to this feature.
selectedFeatureComponent
selectedFeatureComponent: HTMLArcgisFeatureElementReturns a reference to the current arcgis-feature that the Popup is using. This is useful if needing to get a reference to the component in order to make any changes to it.
selectedFeatureIndex
selectedFeatureIndex: numberIndex of the feature that is selected. When features are set, the first index is automatically selected.
- Attribute
- selected-feature-index
state
state: "disabled" | "ready"The current state of the component.
- Attribute
- state
- Default value
- "disabled"
view
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 Popup component will be associated with a map or scene component rather than using theviewproperty.
visible
visible: booleanIndicates whether the popup is visible. This property is true when the popup is querying for results, even if it is not open.
Use the property to check if the popup is visible.
- Attribute
- visible
- Default value
- false
Methods
| Method | Signature |
|---|---|
clear | clear(): Promise<void> |
componentOnReady | componentOnReady(): Promise<void> |
destroy | destroy(): Promise<void> |
fetchFeatures | fetchFeatures(screenPoint: __esri.ScreenPoint, options?: FetchFeaturesOptions): Promise<__esri.FetchPopupFeaturesResult> |
handleViewClick | handleViewClick(event: __esri.ViewClickEvent): Promise<__esri.FeaturesViewModelOpenOptions> |
next | next(): Promise<FeaturesViewModel> |
open | open(options?: __esri.FeaturesViewModelOpenOptions): Promise<void> |
previous | previous(): Promise<FeaturesViewModel> |
setFocus | setFocus(): Promise<void> |
triggerAction | triggerAction(action: __esri.ActionButton | __esri.ActionToggle): Promise<void> |
clear
clear(): Promise<void>Removes all promises, features, content, heading and location from the Popup.
- Returns
- Promise<void>
componentOnReady
componentOnReady(): Promise<void>Create a promise that resolves once component is fully loaded.
Example
const arcgisPopup = document.querySelector("arcgis-popup");
document.body.append(arcgisPopup);
await arcgisPopup.componentOnReady();
console.log("arcgis-popup is ready to go!");- Returns
- Promise<void>
fetchFeatures
fetchFeatures(screenPoint: __esri.ScreenPoint, options?: FetchFeaturesOptions): Promise<__esri.FetchPopupFeaturesResult>Use this method to return feature(s) at a given screen location. These features are fetched from all of the LayerViews in the view. In order to use this, a layer must already have an associated PopupTemplate and have its popupEnabled.
Example
// Example showing how to use fetchFeatures in an application
// with the popup and feature components.
const popupComponent = document.querySelector("arcgis-popup");
const viewElement = document.querySelector("arcgis-map");
const featureComponent = document.querySelector("arcgis-feature");
// Get viewElement's click event
reactiveUtils.on(()=>viewElement, "arcgisViewClick", (event)=>{
const { screenPoint } = event.detail;
// Call fetchFeatures on the popup and pass in the click event screenPoint
popupComponent.fetchFeatures(screenPoint).then((response) => {
// Access the response from fetchFeatures
response.allGraphicsPromise.then((graphics) => {
// Set the feature component's graphic to the returned graphic from fetchFeatures
featureComponent.graphic = graphics[0];
});
});
});Parameters
| Parameter | Type | Optional? |
|---|---|---|
| screenPoint | ScreenPoint | |
| options | FetchFeaturesOptions | undefined |
- Returns
- Promise<FetchPopupFeaturesResult>
next
next(): Promise<FeaturesViewModel>Selects the feature at the next index in relation to the selected feature.
- See also
- Returns
- Promise<FeaturesViewModel>
open
open(options?: __esri.FeaturesViewModelOpenOptions): Promise<void>Opens the popup at the given location with content defined either explicitly with content
or driven from the PopupTemplate of input features. This method sets
the popup's visible property to true. Users can alternatively open the popup
by directly setting the visible property to true.
Note: The popup will only display if the arcgis-map or arcgis-scene size constraints in dockOptions are met or the location property is set to a geometry.
- See also
Examples
reactiveUtils.on(()=>viewElement, "arcgisViewClick", (event)=>{
const { mapPoint } = event.detail;
popupComponent.open({
location: mapPoint, // location of the click on the view
title: "You clicked here", // title displayed in the popup
content: "This is a point of interest" // content displayed in the popup
});
});reactiveUtils.on(()=>viewElement, "arcgisViewClick", (event)=>{
const { mapPoint } = event.detail;
popupComponent.open({
location: mapPoint, // location of the click on the view
fetchFeatures: true // display the content for the selected feature if a popupTemplate is defined.
});
});popupComponent.open({
title: "You clicked here", // title displayed in the popup
content: "This is a point of interest", // content displayed in the popup
location: event.detail.mapPoint,
updateLocationEnabled: true // updates the location of popup based on
// selected feature's geometry
});popupComponent.open({
features: graphics, // array of graphics
featureMenuOpen: true, // selected features initially display in a list
location: graphics[0].geometry // location of the first graphic in the array of graphics
});Parameters
| Parameter | Type | Optional? |
|---|---|---|
| options | FeaturesViewModelOpenOptions | undefined |
- Returns
- Promise<void>
previous
previous(): Promise<FeaturesViewModel>Selects the feature at the previous index in relation to the selected feature.
- See also
- Returns
- Promise<FeaturesViewModel>
setFocus
setFocus(): Promise<void>Use this method to give focus to the component if the component is able to be focused.
- Returns
- Promise<void>
triggerAction
triggerAction(action: __esri.ActionButton | __esri.ActionToggle): Promise<void>Triggers the arcgisTriggerAction event and executes the action at the specified index in the actions array.
Parameters
| Parameter | Type | Optional? |
|---|---|---|
| action | ActionButton | ActionToggle |
- Returns
- Promise<void>
Events
| Event | Type |
|---|---|
arcgisClose | CustomEvent<void> |
arcgisPropertyChange | CustomEvent<{ name: "state" | "active" | "collapsed" | "featureCount" | "visible" | "selectedFeature" | "featureMenuOpen" | "features" | "promises" | "selectedFeatureIndex" | "selectedDrillInFeature" | "selectedFeatureComponent" | "currentAlignment" | "dockEnabled"; }> |
arcgisReady | CustomEvent<void> |
arcgisTriggerAction | CustomEvent<PopupTriggerActionEvent> |
arcgisClose
arcgisClose: CustomEvent<void>Emitted when the component's close button is clicked.
arcgisPropertyChange
arcgisPropertyChange: CustomEvent<{ name: "state" | "active" | "collapsed" | "featureCount" | "visible" | "selectedFeature" | "featureMenuOpen" | "features" | "promises" | "selectedFeatureIndex" | "selectedDrillInFeature" | "selectedFeatureComponent" | "currentAlignment" | "dockEnabled"; }>arcgisReady
arcgisReady: CustomEvent<void>Emitted when the component associated with a map or scene view is ready to be interacted with.
arcgisTriggerAction
arcgisTriggerAction: CustomEvent<PopupTriggerActionEvent>Fires after the user clicks on an action in the Popup component. This event may be used to define a custom function to execute when particular actions are clicked.
Example
viewElement.addEventListener("arcgisViewClick", (event) => {
const { mapPoint } = event.detail;
popupComponent.open({
location: mapPoint,
fetchFeatures: true,
actions: [{
// This text is displayed as a tooltip
title: "Zoom out",
// The ID used to reference this action in the event handler
id: "zoom-out",
// Sets the icon font used to style the action button
icon: "magnifying-glass-minus"
},
{
title: "Delete Feature",
id: "delete-feature-action",
icon: "trash"
}]
});
});
// Fires each time an action is clicked
reactiveUtils.on(()=> popupComponent, "arcgisTriggerAction", (event)=>{
// If the zoom-out action is clicked, execute the following code
if(event.detail.action.id === "zoom-out"){
// Zoom out two levels (LODs)
viewElement.goTo({
center: viewElement.center,
zoom: viewElement.zoom - 2
});
}
});