I am trying to have multiple feature layers that all share one popup in an ArcGIS JavaScript map. As far as I know, the only way to define a popup is on a specific layer, when you do something like:
const myFeatureLayer = new FeatureLayer({
url: '...',
popupTemplate: {
...popupTemplateStuffHere
}
})
When a map has multiple layers, each with their own popups, an ArcGIS map will allow you to toggle through them. But I can't seem to find a way to have all the content from all the different popups end up on a single popup element.
Take this codepen example. There are 2 layers, each describing some data according to county in the US. Each layer has a popup, so when you click a county, you can see the two popups, but only by tabbing through them with the arrows in the bottom right (<
1 of 2 >
, <
2 of 2 >
, etc.) And each popup has data that comes from fields specific to that layer. How can I conglomerate them? I do know that similar things can be done with a Feature widget, but I want this in a popup that opens when the map is clicked.