Create popup with attributes from multiple layers

2709
4
06-18-2021 12:47 PM
JeffThomasILM
Occasional Contributor II

I'm trying to create a custom pop up that includes attributes from multiple layers. Based on this example, it seems like FeatureSets should be the way to do this. The problem is this requires a geometry evaluation; e.g., return any features from layer B that intersect the feature I selected on layer A. This is overly complex; all I want returned are the features (if any) from layer A or B located exactly where I clicked - plain old  popup behavior. I looked at all the geometry functions available but none of them seem to emulate a simple click. Is there a completely different way to accomplish this? Thanks!

4 Replies
jcarlson
MVP Esteemed Contributor

The popup itself should display a "X of N" indicator when your clicked location has multiple features.

jcarlson_0-1624046042492.png

The content of a single popup is defined by the layer, not the map. The click finds three features with popups, and thus three popups, then returns them as "stacked".

That said, you can usually get what you want if you're willing to dig into the JS API for it. Short of that, you may be able to make a widget in Experience Builder (or Web App Builder - Developer Edition) that can list multiple popups in a single frame.

- Josh Carlson
Kendall County GIS
KristalWalsh
Occasional Contributor II

I'm going to try posting this question here. I have not used Arcade before but obviously I need to learn. I have the exact scenario that @JeffThomasILM described but simply I only want to display in the pop-up an attribute from another feature layer. I tried to follow the example provided in this article, "pump-up-your-pop-ups-with-arcade-and-the-living-atlas" and I think the intersection for spatially related data will work for me, but I'm not having any luck with the two layers I'm working with. They are in a web map and do not have any common attributes but are spatially related. If I could get the expression correct, I can use it to create pop-ups for all the rest of my layers. I appreciate any tips. Thank you. Kristal  

Kristal Walsh, Florida Fish and Wildlife
Office of Conservation Planning
Tags (2)
0 Kudos
JeffThomasILM
Occasional Contributor II

@KristalWalsh wrote:

... but simply I only want to display in the pop-up an attribute from another feature layer...


Could you provide more details/examples about what you're trying to do? From your quote above, I'm not understanding why you couldn't just have a pop-up for the one desired layer. 

0 Kudos
JeffThomasILM
Occasional Contributor II

@jcarlson wrote:

The popup itself should display a "X of N" indicator when your clicked location has multiple features.

The content of a single popup is defined by the layer, not the map. The click finds three features with popups, and thus three popups, then returns them as "stacked".

I know this is how pop-ups routinely work, but it's clunky. It would be much more elegant to construct a single pop-up that shows exactly what I want, be it from one layer or several. If that's only possible with custom JS, that is beyond my or most people's capabilities or time constraints. I guess this should be a feature request - something that's possible on any map, not just certain templates that are likely limiting in some other way.


@jcarlson wrote:

That said, you can usually get what you want if you're willing to dig into the JS API for it. Short of that, you may be able to make a widget in Experience Builder (or Web App Builder - Developer Edition) that can list multiple popups in a single frame.


I will definitely explore what can be done with Experience Builder, thanks. I can't believe it's been 2 years since I posted this - perhaps there are more options now! (probably not with WebApp Builder! 😀)