HI
I have a flood layer and a suburb layer. I wrote an Arcade code in the flood layer so when click returns the information of the flood and the name of the suburb
var intersectLayer = Intersects($feature, FeatureSetByName($map,"Suburb"))
for(var f in intersectLayer){
return f.SuburbName
}
But the result in the pop up always has the same suburb name "Suburb 2". I appreciate any help. Thanks
You return the first intersected suburb. If a flood feature intersects multiple suburbs (eg su2 and su3), the expression will only return su2.
Try this:
var intersectLayer = Intersects($feature, FeatureSetByName($map,"Suburb"))
var suburbs = []
for(var f in intersectLayer){
Push(suburbs, f.SuburbName)
}
return Concatenate(suburbs, ", ")
Thanks, Joanes, for your reply, I tested the code, and it gave me the name of all the suburbs that intersect the flood, Are there any way that if my flood intersects several suburbs, but I click in a specific suburb, only return the name of that suburb?
Not really. Arcade doesn't know where you clicked, just on which feature.
You could disable popups for the flood layer and do all the flood related code in the suburb layer.
Thank you