I have a feature class with multiple overlapping polygon layers (state boundary, county boundaries, legislative boundaries and city boundaries) for use in a dashboard. It's published as a feature service, and saved in a map with the 'merged' layer visible, and a copy of the merged layer set with a filter to isolate each type (state, legislature, county and city) as separate layers - these are turned off in the map. Basically i need a pop up to return everything all the time, but not return an empty value for Municipalities when users don't click on a city.
I'm attempting to use Arcade where a user click in the map (on the 'merged' layer) returns a pop up with values from all intersecting, individual type layers at that location. These are returned in a popup where users would toggle using the arrows from one layer to another.
I'm stuck using the intersectLayer function within an if/then, or how to accomplish this otherwise...maybe some of this needs to be handled in the pop up HTML.
Below is what little I have, and the current results (which are not accurate):
Arcade expression:
var buff = Buffer($feature, -50, 'feet')
var intersectLayer = Intersects(FeatureSetByName($map,"Counties"), buff)
for (var f in intersectLayer) {return '$' + Text(Round(Number(f.Total_Funds),2),'#,###,###,###.##')}
Pop up configure HTML:
<div style="text-align: center;"><font color="#c0c0c0" size="4"><b>{expression/expr2}</b></font></div><b><font color="#FFC843">First Tranche Allocation:</font></b> {expression/expr6}<br /> <b><font color="#FFC843">Total Fund Allocation:</font></b> {expression/expr5}
We are working in Portal 10.8.1 and we won't be upgrading until 10.9.1, at which point we may utilize some extended Arcade functionality in Dashboards, but this project is moving forward now.
Thanks