Hello!
I'm using the Arcade Intersects function to pull intersecting layer information and place it within a popup. I've come across a situation where multiple polygons (red border) from one layer intersect my main layer (yellow squares) and the popup only returns a single feature. Is it possible to pull the intersecting feature information where clicked on the map?
Example: The eastern side of the red line is zone 13 and the western side is zone 36. When clicked only the zone 13 information is populated within the popup. Is it possible to pull the information from the intersecting layer where clicked on the map?
Arcade Expression:
var intersectLayer = Intersects(FeatureSetByName($map,"Deer Management Zones"), $feature)
for (var f in intersectLayer){
return text(f.DMZ)
}$map
Thanks!
Hi David Krady ,
When you configure an Arcade expression for a pop-up that should appear when clicking on a feature, you do not have access the actual location where the user clicked. You will only have the clicked feature geometry and not the exact location. (I hope this will be provided at some point in the future).
In your case the expression contains a loop and you use the return inside the loop. When the sequence hits the return, it will exit the arcade expression. So, you will only have the first feature (attribute) it found in the process. To return multiple features, you will need to use a variable that you populate with the results and return that variable after the loop.
Have a look at the example below:
var intersectLayer = Intersects(FeatureSetByName($map, "Deer Management Zones"), $feature);
var cnt = Count(intersectLayer);
var result = "DMZ(s) found:"
// first check if you have any intersecting features
if (cnt > 0) {
for (var f in intersectLayer){
result += TextFormatting.NewLine + " - " + f.DMZ;
}
} else {
result = "no DMZs found..."
}
return result;
Hi @XanderBakker ,
One year later, do you know if the function of clicking on a feature can access to the XY location of the point now existing ?
I would like to have a pop-up in which I can return the information of the layers that intersects this point of identification.
Thanks for your answer
Hi @DeborahDAVID ,
From what I have seen we still don't have this functionality in Arcade today, but I agree with you that it would be great to have.
A year after @DeborahDAVID post ESRI still hasn't solved this basic functionality? Any reason?
is possible, using Arcade, emulate the IDENTIFY command (as in ArcMap, MapObjects, ArcView 3.x...) but instead of using the object $feature show in a POP-UP the field values of the visible layers at location where the user has clicked on the map?
Thnks
Hi @RaimonReventós ,
Almost a year ago I posted an idea (internally) with the title "Provide the location clicked in the pop-up to the Arcade expression". However, the idea is still open...
Thanks for your answer, I`ll try to work in a solution
@RussRoberts @EmilyGeo @bbollin has this functionality been implemented yet?
Hi @MK13 ,
This has been implemented. Please check out the $userInput profile variable which allows you to retrieve the geometry of the location the user clicked and drill down to provide information on other features from other layers in the pop-up.
https://developers.arcgis.com/arcade/profiles/popup/#profile-variables
Hi Xander,
Thank you for implement this new Arcade Popup property.
Sure that many users will found it very useful