Label issue in WAB Print

533
5
Jump to solution
04-06-2018 12:17 AM
mohannainar1
New Contributor III

I have created dynamic feature layer and displaying in web application , the labels looks fine . When I click on custom print the labels are coming improper. The below image green area is dynamic feature layer added in BaseMap. Labels are showing very neatly and looks good . 

When I click on custom Print tool the labels are not coming properly 

0 Kudos
1 Solution

Accepted Solutions
RobertScheitlin__GISP
MVP Esteemed Contributor

Mohan,

   Currently you can not.

View solution in original post

5 Replies
RobertScheitlin__GISP
MVP Esteemed Contributor

Mohan,

   What version of ArcGIS Server are you using? What print server are you using for the first image?

0 Kudos
mohannainar1
New Contributor III

Robert,

I am using ArcGIS Server 10.5.1 . The first image is not the print image, its the WAB app page. Where I am creating a dynamic feature layer on the fly with labels. For labels, I am using "MultiLineTextSymbol.js" from https://github.com/suytt/esri.symbol.MultiLineTextSymbol to show the multiple labels below each other.

When I click print button, it seems, labels are not respecting the map scale, also with labels </br> is coming.

0 Kudos
RobertScheitlin__GISP
MVP Esteemed Contributor

Mohan,

   The ArcGIS Print service does not support custom symbols and that is why it looks the way it does in the print.

0 Kudos
mohannainar1
New Contributor III

Robert,

There is a requirement to show multiple labels below each other as shown in first image. How can I achieve it without using custom symbols?

I am creating dynamic feature layer with labels using below code snippet -

var featureLayerOptions = {
                        mode: FeatureLayer.MODE_SNAPSHOT,
                        outFields: ["*"],
                        infoTemplate: infoTemplate,
                        id: dynamicLayerID
                    };
                    this.dynamicFL = new FeatureLayer(hsFeatureCollection, featureLayerOptions);
                    var statesColor = new Color("#060606");
                    // create a text symbol to define the style of labels
                    var statesLabel = new TextSymbol().setColor(statesColor);
                    statesLabel.font.setSize("9pt");
                    statesLabel.font.setFamily("arial");

json = { "labelExpressionInfo": { "value": "{" + this.firstValueName +"}\n({" +this.secValueName+"})" };

                var labelClass = new LabelClass(json);
               labelClass.symbol = statesLabel; // symbol also can be set in LabelClass' json
                this.dynamicFL.setLabelingInfo([labelClass]);
                 this.map.addLayer(this.dynamicFL);

Kindly suggest.

0 Kudos
RobertScheitlin__GISP
MVP Esteemed Contributor

Mohan,

   Currently you can not.