Anyone know if and how I can create the Label expression that puts the values on 2 lines?
"expression":"$feature.Owner1 + ' GO TO NEXT LINE ' + $feature.MapNumber "
LabelDefinition {
json: {
"labelExpressionInfo":{
"expression":"$feature.Owner1 + ' ' + $feature.MapNumber "
},
// SNIP
} // END OF LAYER DEFINITION
Solved! Go to Solution.
So the LabelDefinition takes JSON object based on this doc, LabelDefinition QML Type | ArcGIS for Developers, so I assume it would be something like "\\n"
See this, javascript - How do I handle newlines in JSON? - Stack Overflow
Something like the vbNewLine used in ArcMap Label expressions?????
Tried this but no go
"expression":"$feature.Owner1 + '\n' + $feature.MapNumber"
So the LabelDefinition takes JSON object based on this doc, LabelDefinition QML Type | ArcGIS for Developers, so I assume it would be something like "\\n"
See this, javascript - How do I handle newlines in JSON? - Stack Overflow
Yea thats what I was referencing....looked everywhere...every place I looked and found something it was \n
no where did i see if referenced with two \\ as your example \\n
But that seems to have worked...
// NO
"expression":"$feature.Owner1 + '\n' + $feature.MapNumber"
// YES
"expression":"$feature.Owner1 + '\\n' + $feature.MapNumber"
Glad that it works. You need to escape the "\" in the string (turning it into a double-"\")
I was almost there....ahahhahaahah
one stupid \
Have a great weekend