Does anyone know how to label a feature class with multiple lines in ArcGIS Online? On Desktop, labels can be done via:
... I am hoping to do the same with ArcGIS Online.
Thanks for your help!
If you are using a feature layer, you can do it this way:
Note that these expressions are built using ArcGIS Arcade. Plenty of help docs exist to help you become an expert!
Unfortunately, since Arcade doesn't support NewLine in the map viewer or template apps, you can't put them on separate lines. However, there does appear to be a workaround as noted in this thread.
Arcade Text Constant for TextFormatting.NewLine is adding space instead of new line
The workaround that was mentioned does not apply for labels. There is some advancement since the playground will now show the multi line result, however this will not be applied for the labels in the map:
What you can do is duplicate the layer and and use the label positioning to have two lines (with 3 lines it will not fit and it will not show one of the labels).
So copy the layer and use different alignments for the labels of each layer:
to go from this
Looks like there is only the option to determine label placement for points and lines, not for polygons. Any suggested workarounds for polygons?
You could create label point for the polygons and label those, but that would be a complex way to achieve something that should be so easy.
Retrieving data ...