Hello I was able to generate a thumbnail image using PrintTask from a WAB widget via http://mycomputer:3344/webappviewer/?config=sample-configs/config-demo.json. But after I added the widget to one of my apps using WAB dev edition. i got an error below
Not sure why it worked through the custom widget testing url but didn't work after I added it to my application. Can you please help?
_printTask: null,
_printTaskParams: null,
_thumbnailHeight: 200,
_thumbnailWidth: 200,
_thumbnailDpi: 96,
_thumbnailFormat: 'PNG32',
_templateLayout: "MAP_ONLY",
_preserveScale: false,
_showAttribution: false,
_exportWebMapTaskUrl: 'http://sampleserver6.arcgisonline.com/arcgis/rest/services/Utilities/PrintingTools/GPServer/Export%2...',
_initPrintTask: function(){
this._printTask = new PrintTask(this._exportWebMapUrl);
var template = new PrintTemplate();
var params = new PrintParameters();
template.exportOptions = {
width: this._thumbnailWidth,
height: this._thumbnailHeight,
dpi: this._thumbnailDpi
};
template.format = this._thumbnailFormat;
template.layout = this._templateLayout;
template.preserveScale = this._preserveScale;
template.showAttribution = this._showAttribution;
params.map = this.map;
params.template = template;
this._printTaskParams = params;
},
_createThumbnail: function(){
this._printTask.execute(this._printTaskParams, lang.hitch(this, function(result){
this._storeThumbnailUrl(result.url);
}));
},