Select to view content in your preferred language

Print widget scale bar problem

3803
4
Jump to solution
02-11-2014 06:58 AM
by Anonymous User
Not applicable
Original User: STwork

I published a printing service so I could use my templates. The templates include a scale bar. For some reason the scale bar doesn't match the scale of the map when it prints. It adjusts when I check the 'Use this Scale' option as an end user, but it isn't correct either way.

Attaching some pictures to show how this string of 50' lots doesn't scale properly.

[ATTACH=CONFIG]31314[/ATTACH]   [ATTACH=CONFIG]31315[/ATTACH]

I am stumped. Any insight as to why this would happen would be helpful.
0 Kudos
1 Solution

Accepted Solutions
by Anonymous User
Not applicable
Original User: STwork

Turns out this is a known bug.

Documented here.

View solution in original post

0 Kudos
4 Replies
by Anonymous User
Not applicable
Original User: STwork

Turns out this is a known bug.

Documented here.
0 Kudos
TrevorWeiland
Regular Contributor


Can this known limitation of the Flex Viewer be added to the help documentation so that future users won't waste hours trying to find this simple answer?

0 Kudos
DavidDe_Reu
New Contributor

I found a solution to this bug on another site. The scale bar was not correct when printing from an application in Web Mercator. You need to adapt the Print.js file of the print widget and change the following line:

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

into something like:

this.printparams.outSpatialReference = new SpatialReference(32631);

32631 has to be changed to a Spatial Reference WKID of your region. My MXD templates used by the print service are having the same reference system.

And of course, you have to

define(["esri/SpatialReference" ...], function (spatialReference... 

in the beginning of the Print.js file (the order of elements in the define-part has to be the same as in the function-part)

simoxu
by MVP Regular Contributor
MVP Regular Contributor

No idea why ESRI commented out the following line in the print.js code. 

//fix issue #7141
// this.printparams.outSpatialReference = this.map.spatialReference;