Select to view content in your preferred language

Print Plus tool: Not able to retain map extent in the print out

3626
8
06-01-2016 08:37 AM
RogerF
by
Regular Contributor

Thank you for the great tool Larry.

Print Plus Widget Version 1.1.6 July 12, 2015

I am trying to use print plus tool with ArcGIS Server's print default print service. I am on Web AppBuilder 2.0. When I try to use scale slider to adjust the map extent for print out, the print output does not retain the map extent correctly. I have attached the screen shots to illustrate the problem. Not sure if it is a known issue or I have not configured the tool correctly.

Thank you,

0 Kudos
8 Replies
RickeyFight
MVP Regular Contributor

Roger Federer,

Were you ever able to get this figured out ?

0 Kudos
RickeyFight
MVP Regular Contributor

I found the solution. In printplus.js

Change :

this.printparams.outSpatialReference = this.map.spatialReference;

to this:

this.printparams.outSpatialReference = new esri.SpatialReference({wkid:yourwkid});

You will need to also add

require(["esri/SpatialReference"], function(SpatialReference)

in the appropriate sections.

You will then need to change the size of the page in the config. I went from around 8.5x11 to 11.65x14.8

0 Kudos
RogerF
by
Regular Contributor

Hi Rickey

Thanks for you response. However I am not sure if I understood you response.

I see that in printplus.js file, on line # 160.

what value you will provide to <yourwkid> ? Is not it same as your map's spatial reference ? 

Can you provide some details ? 

0 Kudos
RogerF
by
Regular Contributor

Larry_Stout‌,

Can you please help me with this ?

Thank you,

0 Kudos
RebeccaStrauch__GISP
MVP Emeritus

Roger, just an fyi, Larry_Stout‌ switched jobs since he wrote many of his great tools. He's not on geonet as often. Hopefully this will pring him again and he'll see it...but just in case he doesn't, that is why.

0 Kudos
RogerF
by
Regular Contributor

Thanks Rebecca for letting me know. I hope he sees this post early.

0 Kudos
RickeyFight
MVP Regular Contributor

I put in the spatial reference that is local for me and my services. For me that is 2270

So mine looks like this:

 this.printparams.outSpatialReference = new esri.SpatialReference({wkid:2270});

Quoting Ben Fousek‌ here: 

"If outSpatialReference is not set it uses the map's projection (102100)."

Print task scale bar accuracy question 

RogerF
by
Regular Contributor

Thank you Rickey for clarification. 

My map uses arcgis online basemap and operational data is also in WGS84 (same coordinate system). hence custom map extent is not getting retained.

0 Kudos