ArcGIS Online label expression

4074
3
Jump to solution
04-10-2015 08:54 AM
RobertWhite2
New Contributor II

I am working with a series of maps in AGO and would like to create nuanced label expressions--e.g. stuffing a carriage return into the label (as we've done with VB and Python, in Desktop).  Is this doable as yet (perhaps through the use of inserted special characters, html markup, etc.)?

thanks

-caminante

1 Solution

Accepted Solutions
KellyGerrow
Esri Frequent Contributor

Hi Robert and Kevin,

Currently the 3X Javascript API does not support the Arcade expression that adds a newline.

This web map, has the proper expression, but you will see that the labels are not stacked:

Arcade Expression: "APN: "+$feature.PIN +TextFormatting.NewLine+ "Acres: "+Round($feature.ACRES, 2)

Map: https://arcg.is/9a0SX 

However, when this app is included in a 4X Javascript API, the Newline function is applied to the labels:

https://onlineshowcase.maps.arcgis.com/apps/Media/index.html?appid=fa4ad95adbad410aaf00790a3c18d0f8 

Currently, Media Map, Styler and Minimal Gallery are available in 4X and can take advantage of the Newline function with Arcade.

-Kelly

View solution in original post

3 Replies
KevinDeege
Esri Contributor

Hi Robert, adding nuanced label expressions can be accomplished by editing web maps creating in ArcGIS Online or ArcGIS Enterprise using the Map Viewer and working with Arcade expressions.   Arcade provides formatting functions as well as global variables that provide direct access to features in the map for labeling purposes.  Here is an example web map that illustrates the process involved.

0 Kudos
KellyGerrow
Esri Frequent Contributor

Hi Robert and Kevin,

Currently the 3X Javascript API does not support the Arcade expression that adds a newline.

This web map, has the proper expression, but you will see that the labels are not stacked:

Arcade Expression: "APN: "+$feature.PIN +TextFormatting.NewLine+ "Acres: "+Round($feature.ACRES, 2)

Map: https://arcg.is/9a0SX 

However, when this app is included in a 4X Javascript API, the Newline function is applied to the labels:

https://onlineshowcase.maps.arcgis.com/apps/Media/index.html?appid=fa4ad95adbad410aaf00790a3c18d0f8 

Currently, Media Map, Styler and Minimal Gallery are available in 4X and can take advantage of the Newline function with Arcade.

-Kelly

View solution in original post

KevinDeege
Esri Contributor

Awesome, thanks for that helpful clarification and insight Kelly!

0 Kudos