AnsweredAssumed Answered

Arcade expression for custom symbology

Question asked by cpoynter on Nov 11, 2018
Latest reply on Nov 13, 2018 by kenbuja

Hi All,


I have read several different blogs and postings to try and achieve a task in ArcGIS Online.  I would like too, based on two fields provide a custom image for a symbol for my webmap.  I want users to nominate an issue (i.e. snake sighting), and then calculate a period of time for when the webmap is viewed, to have the symbol change with age from a 'High' (<12 hours) indicent to 'Low' (> 48 hours) incident. So over the course of 2 days the symbol might change from a red snake to a green one.


The following code is my attempt so far to at least show the correct image within a pop-up.

var startDate = Date($;
var endDate = Now();
var age = DateDiff(endDate, startDate, 'hours');
When (
    age <= 12,'High',
    age > 12 && age <= 24, 'Medium',
    age > 24 && age <= 48, 'Low','Historical');

var issue = ($feature.issue)

if (issue == 'Snake' && age == 'High'){
return "snake1.png"
} else
if (issue == 'Snake' && age == 'Medium'){
return "snake2.png"
} else
if (issue == 'Snake' && age == 'Low'){
return "snake3.png"
} else
return "bird1.png"

I am finding that the bird1.png is showing, even though I only have snake events in my data.


What I ultimately want is a custom symbol using my PNG file, and then go one step further to place a buffer of set distance around point locations and color those with incident level (red/amber/green).


I am hoping this is something Arcade might be able to do.