I have a FeatureLayer that I am setting .labelingInfo. In my map view the labels are shown correctly but in my web map export PDF, the label values are wrapped. And ideas how to not wrap the labels in the PDF export?
Labeling code:
const nameArcade = "var in_val = $feature." + label_field + "\n" +
"var decimal_val_threshold = 1" + "\n" +
"if (in_val >= decimal_val_threshold) {" +
" return Text(Round(in_val, 0), '#,###')" +
"} else {" +
" return ' <1'" +
"}";
const nameClass = {
labelPlacement: "always-horizontal",
labelExpressionInfo: {
expression: nameArcade
},
minScale: min_scale,
symbol: createTextSymbol("white", "black")
};
function createTextSymbol(color, halo_color) {
return {
type: "text",
font: {
size: 12,
weight: "bold"
},
color: color,
haloColor: halo_color,
haloSize: 1
};
}
Map view of labels:
PDF showing wrapped labels:
Hi @julian_svcs, thanks for sharing your issue here. It looks like this might be due to an issue with the print service, we are currently investigating.
The issue is probably caused by the comma and the space constraints, because the comma is a default stacking separator, and it looks like the wrapping only occurs where the space is tight. One workaround suggestion would be to set the deconflictionStrategy to none and see if that helps (or makes it look worse).
Another workaround option would be to try returning a number instead of a string from the Arcade expression.
Thanks for the reply.
It is the comma in the label when it is printed (which is not the same as the map's labels). It doesn't seem to be because of the tight spaces. See the different scales and how the behave differently. There is also an example of the labels as a number. This is with deconflictionStrategy:"none",.
Ok, thanks for trying out those potential workarounds. We'll continue investigating the print service, and will update this thread when there is something useful to share.
Our team is also experiencing this issue. Have any viable workarounds or solutions been discovered?
- Jake