ArcGIS Online label classes from symbology arcade help

503
0
01-21-2021 01:26 PM
Labels (1)
by Anonymous User
Not applicable

Hello all,

I am new to arcade and new to ArcGIS Pro 2.7. Long time ArcMap user. Anyway, I have a point feature class that is symbolized based on a field - different color for each value. I want the label color to match the point color. I am able to do this in ArcGIS Pro using the "create label classes from symbology". https://pro.arcgis.com/en/pro-app/latest/help/mapping/text/label-classes.htm 

Once I share this as a service to my ArcGIS Server and then put that in an AGOL map, the labels are gone, of course. So if I try to recreate the labels in AGOL I have to code something in Arcade. I have gone down the rabbit hole and found a few links, https://developers.arcgis.com/javascript/latest/sample-code/labels-multiple-classes/index.html   https://developers.arcgis.com/javascript/latest/guide/arcade/#labeling 

Unfortunately these only get me so far. I'm not able to figure out how to recreate with Arcade code what I have in ArcGIS Pro. orange dot = orange label, red dot = red label etc. 

Has anyone done some code like this that could share with me please?

So close, yet so far. Thanks in advance,

Andrea

0 Replies