Arcade Expression not Displaying in Map
In one of my HTML5 viewers, I have a map service of food inspector districts and a feature service of food inspection points. Some of the facilities in the point layer have more than one permit type of permit and therefore have more than one point on the map. However, each permit has a unique record number.
I added three arcade expressions to the district layer to show counts of the points.
The first expression calculates the number of permits in the district, so it simply adds up all the points. This expression successfully shows the resulting count of points in the map tip.
var insp = FeatureSetByName($map, "AllFoodInspections")
var inspIntersect = Intersects($feature, insp)
var inspCount = Count(inspIntersect)
return inspCount
The second expression calculates the number of facilities in the district. So instead of adding up all the points, it gets a list of unique Facility IDs and returns the count of those.
var fac = Intersects($feature,FeatureSetByName($map, "AllFoodInspections", ["FACILITY_ID"]))
var facDist = Distinct(fac, "FACILITY_ID")
var facCount = Count(facDist)
return facCount
The third expression calculates the number of inspections in the district per fiscal year. This one is a little more tricky because the number of inspections per fiscal year varies from 1-3 depending on the PE code.
var insp = FeatureSetByName($map, "AllFoodInspections", ["PE"])
var fs = Intersects($feature,insp)
var one = ['FM09', 'RE05', 'RE09', 'SW20', 'SW21', 'HO02', 'HO18', 'HO22', 'TB01', 'TB11', 'TB12']
var two = ['FM10', 'RE06', 'RE10', 'HO19']
var three = ['FM11', 'RE11', 'HO20']
var i = 0
for (var f in fs) {
var val = When(Includes(one, f.PE), 1, Includes(two, f.PE), 2, Includes(three, f.PE), 3, 0)
i += val
}
return i
I originally wrote all of the expressions in the pop-up configuration in ArcGIS Pro because I wanted to make sure that they work. Once I got them working in Pro, I copied and pasted them into Geocortex. The only thing I changed in Geocortex was the name of the layer, "AllFoodInspections", because I have it named slightly differently in Pro. Other than that though, the expressions and the data are exactly the same. But for some reason, the first expression is the only one that works properly in Geocortex.
I tried removing the first expression from the map tip, thinking that maybe once the most simple expression evaluated, it gave up on the other two expressions. But when I did that, the map tip loaded much faster, as if it wasn't even trying to evaluate the expressions in the map tip.
Has anybody else run into anything like this? If it makes any difference, the district layer is actually in a layer catalog that not all employees have access to. It runs the arcade expression against an invisible feature layer that is already sitting in the map.
I'm on GE version 4.14.1.
0
Du måste logga in om du vill lämna en kommentar.
Kommentarer
0 kommentarer