PrintTask 4.3 Rotation issue

1247
4
03-23-2017 10:48 AM
JordanBaumgardner
Occasional Contributor III

I'm using  "esri/tasks/support/PrintTemplate", "esri/tasks/support/PrintParameters", and "esri/tasks/PrintTask" to hit an ArcGis Server 10.4.1 Print service and everything is great until I rotate the map.

1) How do I add rotation to the webMap that the Print Task builds?

2) When I add the rotation to the WebMap Json and make the call with the HTML interface on ArcGis Server, it cuts off the outer edges at the corners. If I point it due north - everything is fine. I'm trying to get a screen shot and a JS fiddle but my data is sensitive and I need to find a different data src first. The white line is Very reminiscent of the rotation bug introduced in 4.2 and fixed in 4.3 but on the server side. The white seems to be where the due north boundaries would be. 

Thanks in advance.

0 Kudos
4 Replies
JordanBaumgardner
Occasional Contributor III

Update:

I was setting up a JSBin and .... well it worked.

[I'm capturing the WebMap as it is transmitted and then taking that to the HTML page and adding rotation.]

So it appears to be something with my data.

Any thoughts are much appreciated.

0 Kudos
JordanBaumgardner
Occasional Contributor III

Sorry, The white space is on the edge, not the middle. Same looking issue with 4.2 in the browser.

0 Kudos
JordanBaumgardner
Occasional Contributor III

Adding a comment to bump this to the top of the feed again. Anyone with any thoughts?

0 Kudos
JordanBaumgardner
Occasional Contributor III

Found how to add rotation, but am still getting the corners cut off as in the 4.2 MapView rotation error.

I subclass PrintTask and override execute. I insert the rotation into the Web_Map_as_JSON before the submit.

var CustomPrintTask = EsriPrintTask.createSubclass({
   execute: function (a, b) {
      internalPrintPrams = this._setPrintParams(a);
      internalPrintPrams.Web_Map_as_JSON = internalPrintPrams.Web_Map_as_JSON

         .replace(/mapOptions":{/gi,'mapOptions":{"rotation": -' + a.view.rotation.toString() + ',');
      return this._geoprocessor["async" === this.mode ? "submitJob" : "execute"](internalPrintPrams, b)
         .then(this._handleExecuteResponse)
   }
});

me.myPrintTask = new CustomPrintTask();
me.myPrintTask.url = printUrl;
me.myPrintTask.mode = "async";

me.myPrintTask.execute(prntPrms).then().otherwise();

0 Kudos