So I have a layer intersect with a negative buffer expression that pulls zone information from the zone layer and displays it on the parcel pop-up. The expression has been working for about a year and half now with no issues. Yesterday there was an ArcGIS Online outage and afterwards my parcel feature service was corrupted and no longer available to use. After working Technical Support it was determined the data could not be saved and I had to re-upload the data fresh to ArcGIS Online. This also means I have to re-add the parcel feature service and reconfigure my pop-up. After putting in my expression exactly as before I am not getting any results in the pop-up on the map out side of the extra line in the pop-up. Running a test gives me a successful run of the expression but an empty result. As far as I am aware nothing else has changed.
var parcelac = area($feature, 'ac');
var zones = FeatureSetByName($map,"Land Use Zoning");
var feature_buf=Buffer($feature,-5, 'feet');
var IntersectLayer3=Intersects(zones, feature_buf);
var area_max = 0;
var ZoneName = "";
var result = "";
var cnt = Count (IntersectLayer3);
if (cnt > 0) {
for (var zone in IntersectLayer3) {
var area_i = Area(Intersection($feature, zone), 'ac');
var perc_i = Round(area_i/parcelac * 100.0, 2);
if (area_i > area_max) {
area_max = area_i;
ZoneName = zone.Zone_;
}
}
result += ZoneName;
} else {
result = "There is only one (1) zone.";
}
If anybody has any ideas or sees something I have missed or even a more efficient expression I am all ears.
Solved! Go to Solution.
You're not returning anything from the expression. Try adding this as the last line:
return result
You're not returning anything from the expression. Try adding this as the last line:
return result
Well, that worked. Now I'm really curious why it was working before the layer corruption without the "return".