@jkumartry1980 Yes, I got it working, but it took a bit to get everything in place.
First, I added the popupTemplate to all the feature layers in my map
layerToAdd = new FeatureLayer(layer.service_url, {
outFields: ['*'],
id: layerName,
popupTemplate: {}, // required to trigger info panel
visible
})
Then I listened for a click on the view, and looked at all of the results:
this.view.on('click', async (event) => {
// Use popup to select features on the map. Only features with popupTemplate enabled will be selected
const resp = await view.popup.fetchFeatures(event)
const results = await resp.allGraphicsPromise
if (Array.isArray(results)) {
if (results.length === 0) {
this.$emit('pointer-clicked-outside')
return
}
const popupResults = results.filter((r) => {
//do something with results, like highlight the selected feature
await this.highlightItem(r)
})
}
})
Lastly, I highlighted the selected graphic
async highlightItem (gisInfo) {
const { view } = this
if (gisInfo.layer) {
const layerView = await view.whenLayerView(gisInfo.layer)
const selected = layerView.highlight(gisInfo)
this.highlightSelect.push(selected)
} else if (gisInfo?.sourceLayer?.layer) {
const layerView = await view.whenLayerView(
gisInfo.sourceLayer.layer
)
const selected = layerView.highlight(gisInfo)
this.highlightSelect.push(selected)
}
}
I stripped out the code that wasn't applicable. I'm not sure if what I have above will work exactly as-is, but hopefully it gets you on the right track.