Textsymbol not printing at all

2935
19
Jump to solution
07-03-2019 06:11 AM
DeanWilson
New Contributor III

I've seen a lot of the textsymbol questions in the forums here and have tried every one of them.  My issue is the textsymbol doesn't show up at all on the print.  It shows on the map as built.  Here's the code as to how I'm putting this together.  I also tried putting this layer together by itself (to take the fact there are multiple graphics layers out of the scenario) and still getting the same issues.  Here's my method:

_buildRatioViewerGraphics: function(ratioViewerData){
let features = [];
let textFeatures = [];

arrayUtils.forEach(ratioViewerData, lang.hitch(this, function(ratioFeature){
   let polySymbol = new SimpleFillSymbol(
      SimpleFillSymbol.STYLE_SOLID,
      new SimpleLineSymbol(
         SimpleLineSymbol.STYLE_SOLID,
         new Color(this._ratioColorPicker(ratioFeature.attributes.ratio)),
         0.4
      ),
      new Color(this._ratioColorPicker(ratioFeature.attributes.ratio))
   );
   let featureGraphic = new Graphic(ratioFeature);
   featureGraphic.setSymbol(polySymbol);
   features.push(featureGraphic);

   let textColor = new Color();
   textColor.setColor([0, 0, 0, 1]);

   let textFont = new Font();
   textFont.setSize("12pt");
   textFont.setWeight(Font.WEIGHT_BOLD);
   textFont.setFamily("Arial");

   let textSymbol = new TextSymbol()
      .setText(this._formatRoutingNumberLabel(ratioFeature.attributes.routingNumber))
      .setFont(textFont)
      .setColor(textColor)
      .setAlign(Font.ALIGN_MIDDLE)
      .setAngle(0)
      .setHaloColor(new Color([255, 255, 255, 0.3]))
      .setHaloSize(1);
      textSymbol.horizontalAlignment = "center";
      textSymbol.verticalAlignment = "center";
      let textFeatureGraphic = new Graphic(ratioFeature);
      textFeatureGraphic.setSymbol(textSymbol);
      textFeatures.push(textFeatureGraphic);
   }));

   this.featureLayer.applyEdits(features, null, null);
   this.textFeatureLayer.applyEdits(textFeatures, null, null);

return features;
}
0 Kudos
19 Replies
DeanWilson
New Contributor III

Still looking for some insight on this issue. Thanks!

--Dean

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

Have you made the call to esri tech support?

0 Kudos
DeanWilson
New Contributor III

No I haven't. I was hoping I could find something here since I'm sure I'm not the only one having this kind of problem.  I suppose I'll have to call them though.

0 Kudos
TanuHoque
Esri Regular Contributor

I agree this issue needs to taken to Esri tech support.

In the meantime, pls take a look at the value passed in for the parameter named 'webmap_as_json' for the print service. you can use any browser's Developer's Tools >> Network tab to trace the request. If you share that here (zip it if the json is large), I can take a quick look at that too.

DeanWilson
New Contributor III

My only holdup with getting with ESRI about it is the fact that we're on a 10.4.1 arcgis on-premise server.  But on any case, I'll take a peek and see what I can get to you, Tanu. Thanks!

0 Kudos
DeanWilson
New Contributor III

I attached the print submission json as a zip to the question posting.  I went ahead and formatted the json for easier readability.  Thanks!!

-Dean

0 Kudos
TanuHoque
Esri Regular Contributor

Thanks Dean Wilson‌.

It looks like the graphic layer that your JS code creates to show text, are of polygon type. That is currently not supported in print services.

Try change that to point geometry type. That should make it to work.

see the attached .zip file that is a modified version of what you sent me. if you use that in a request to your print service, you should see one feature gets labeled (to keep it simple, I removed all other labels from the json).

hope this helps.

DeanWilson
New Contributor III

This did it Tanu.. I went ahead and used the geometry service on the existing polygon rings and put label points as the geometry and drew them that way. They show up in the prints great! Thank you soooo much for your insight on this.  Nowhere did I see that in order to print the text graphics the geometry needed to be of type point.  

-Dean

0 Kudos
TanuHoque
Esri Regular Contributor

Hi Dean, thanks for the updates. I'm glad that it worked for you.

Nowhere did I see that in order to print the text graphics the geometry needed to be of type point. 

You are right, unfortunately this is not doc'ed any where. Sorry about the inconvenience. We will look at this from the doc side and see how we can improve that.

Noah-Sager
Esri Regular Contributor

Follow-up: we will have the documentation updated to make this clear for the next release (3.30), which is due out in October.