This sample adds the Feature (Next) component in a side panel, keeping feature details separate from the map. The component displays content from the feature’s PopupTemplate, configured on the referenced layer with custom text elements and chart media.

This example adds the Feature (Next) component to a Calcite side panel and references the map component.

<calcite-shell>
<calcite-shell-panel slot="panel-start">
<arcgis-feature-next style="width: 100%" reference-element="my-map"></arcgis-feature-next>
</calcite-shell-panel>
<arcgis-map id="my-map" item-id="cab6c53ebefc428191dea9b5d855d060" popup-disabled>
<arcgis-zoom slot="top-left"></arcgis-zoom>
<arcgis-expand slot="bottom-right">
<arcgis-legend></arcgis-legend>
</arcgis-expand>
</arcgis-map>
</calcite-shell>

Then, an event listener is added to the Map component arcgisViewPointerMove event and calls fetchPopupFeatures() to get popup features under the cursor. The returned async generator is collected into an array, and the first feature from the Tract layer is assigned to the arcgis-feature-next component’s graphic property and highlighted in the map.

const fetchFeature = promiseUtils.debounce(async (event) => {
const generator = await viewElement.fetchPopupFeatures(
{ x: event.x, y: event.y },
{ pointerType: event.pointerType },
);
const graphics = await Array.fromAsync(generator);
return graphics.find((graphic) => graphic.layer === featureLayer);
});
viewElement.addEventListener("arcgisViewPointerMove", async (event) => {
try {
const graphic = await fetchFeature(event.detail);
const newObjectId = graphic?.attributes[featureLayer.objectIdField];
if (newObjectId == null) {
highlight?.remove();
highlight = undefined;
objectId = undefined;
arcgisFeature.graphic = defaultGraphic;
} else if (objectId !== newObjectId) {
highlight?.remove();
objectId = newObjectId;
arcgisFeature.graphic = graphic;
highlight = layerView.highlight(graphic);
}
} catch (error) {
if (!promiseUtils.isAbortError(error)) {
console.error("Unexpected fetchPopupFeatures error:", error);
}
}
});
2DPopupPopupTemplatepaneltooltipschartfetchPopupFeatureshighlightisAbortErrorpromisepromiseUtilsdebounceviewOnReadyarcgis-expandarcgis-feature-nextarcgis-legendarcgis-maparcgis-zoomarcgisViewPointerMovemap-componentscalcite-shellcalcite-shell-panelcalcite-components5.2