Graphics on Graphics Layers seems to cause PrintTask to crash

438
4
04-12-2019 08:47 AM
ChrisMahon3
New Contributor II

I am using the print task from the sample code here

Print templates with esri.request | ArcGIS API for JavaScript 3.28 

It works fine until there are polygon graphics drawn on one of my graphics layers that have been drawn on the map, then it crashes with this error

Error: "Unable to complete operation." Print.js:9:144

0 Kudos
4 Replies
Noah-Sager
Esri Regular Contributor

Thanks for reporting this, Chris. It looks like an issue. We'll investigate.

0 Kudos
ChrisMahon3
New Contributor II

Hi Noah,

I was able to find a find a work around, I was adding polygon graphics to my graphics layer - and found the ",42 ,42"

Once I removed that it worked.  I'm not sure why I had ",42 ,42" in my code... no errors until I needed to print them...?!?!  

symbol = new SimpleFillSymbol(SimpleFillSymbol.STYLE_FORWARD_DIAGONAL,new SimpleLineSymbol( SimpleLineSymbol.STYLE_SOLID,new Color('#' + document.getElementById("tdrawcolor").value),3), 42, 42);

change too

symbol = new SimpleFillSymbol(SimpleFillSymbol.STYLE_FORWARD_DIAGONAL,new SimpleLineSymbol( SimpleLineSymbol.STYLE_SOLID,new Color('#' + document.getElementById("tdrawcolor").value),3));

So the print tools didn't like those polygon graphics...

0 Kudos
Noah-Sager
Esri Regular Contributor

Thanks for the update, Chris. I tested with SimpleFillSymbol instead of PictureFillSymbol, and it printed fine. Then I moved the PictureFillSymbol image to be publicly hosted (instead of locally hosted on my own server, which the public print service had trouble accessing), and it printed fine as well. I'm not sure about the ",42 ,42", but perhaps it was a vestigial code snippet that got copied in? 

0 Kudos
ChrisMahon3
New Contributor II

Yes, i can't put my finger on where the ",42 ,42" came from?  I looked back at my archived backups of my application and it appears in all.  So at some point when I began building the application I pasted/entered it, It didn't throw any errors so it never got noticed until now.

Thanks for your assistance.