Arcade works in map viewer classic but not the new map viewer

283
0
01-18-2022 04:42 AM
Labels (3)
DaveBodak
Occasional Contributor

I am working on creating a hydrant inspection map with different symbols for each given case on the status of a hydrant inspection. The three cases are: Not Inspected; Needs Attention; Inspected. The code I have written works in map viewer classic, but not the new map viewer. The difficult part is that Dashboards references the new map viewer so the symbology does not show up correctly.

The way this is set up is to have a hydrant feature layer, and a recent hydrant inspections layer overlaying the hydrant layer underneath (this is better shown in the second image). The recent hydrant inspections layer refreshes when a new inspections is performed and the most recent one is displayed.

Here is the code for the three cases, I have multiple factors triggering a "Needs Attention" return. I know this probably isn't the cleanest way to do it but it is what I have found to work well.

if (DateDiff(now(), $feature.InspectionDate, 'years')<4)
{
if (DomainName($feature,"InspStat") == "No")
return ("Needs Attention")
else if (DomainName($feature,"BoolMaint") == "Yes")
return ("Needs Attention")
else if (DomainName($feature,"OilBonnet") == "Yes")
return ("Needs Attention")
else 
return ("Inspected")
}
else if (DateDiff(now(), $feature.InspectionDate, 'years')>4)
return ("Needs Inspection")

This is the result with some test inspections that we have done on some hydrants:

DaveBodak_0-1642509015591.png

When I go to the new map viewer, only the hydrant still requiring inspection is displaying in the feature layer for hydrant inspections, as shown in the bottom right corner:

DaveBodak_1-1642509081064.png

I also noticed that I am unable to select a recent inspection when I select one of the hydrants missing the symbols, but the table still contains all of the inspections that have been performed.

If there isn't a solution to this, is there a way to have dashboards reference the map in map viewer classic so that I can get the symbology to work correctly?

Thank you for your help!

 

0 Kudos
0 Replies