Select to view content in your preferred language

Pop ups with Multiple Intersecting Layers

596
1
03-02-2023 12:47 PM
Labels (1)
BNix_TPA
Emerging Contributor

I'm working on creating pop-ups for my Units for ArcGIS Indoors.  My zones layer displays lease polygons.  When I click on the pop-up for the Units I would like the corresponding zone "Long Name" to appear in the pop-up.  I started with this code, but I'm missing something

var intersectLayer =Intersects(FeatureSetByName($map,"Zones"), $feature)

for (var f in intersectLayer){
return f.NAME_LONG
}

Since the polygons are multiple stacked floors the correct zone isn't always returned, it returns whatever zone is on top or the highest floor.  I need something else to only have the zone that is on the same floor as the unit to be returned.

Tags (2)
0 Kudos
1 Reply
KenBuja
MVP Esteemed Contributor

You have to add an if statement or logical function to return only the feature that corresponds to your zone. You would have to substitute the correct attribute for the if statement  shown below

var intersectLayer =Intersects(FeatureSetByName($map,"Zones"), $feature)

for (var f in intersectLayer){
  if ($feature.Floor == f.Floor){
    return f.NAME_LONG;
  }
}