Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Print Widget Scale Error #682

Open
rick-gse opened this issue Mar 1, 2017 · 3 comments
Open

Print Widget Scale Error #682

rick-gse opened this issue Mar 1, 2017 · 3 comments

Comments

@rick-gse
Copy link

rick-gse commented Mar 1, 2017

Using the out-of-the-box CMV, if I zoom in to a location and use the Print widget, the scale bar is incorrect - It didn't matter if I chose PDF or JPG....

I copied the scale bar and moved it to the location on the map, and used the measurement widget to create ticks at one mile increments:

image

I noticed that the scale bar was about 1.3 times shorter than it should be which is 1/cos(40°), my latitude.
So I looked at Quito, Ecuador, and sure enough, the scale is correct:

image

The only way I found to fix it was to set the outSpatialReference in printParamerters to Colorado North State Plane

image

Changes to print.js:

        this.printparams = new PrintParameters();
        this.printparams.map = this.map;
        this.printparams.outSpatialReference = new SpatialReference(2231);  // Coloroado North State Plane
        //this.printparams.outSpatialReference = this.map.spatialReference;

Seems like the scale bar should always be correct, and I shouldn't have to set the SpatialReference, or am I missing something?

Thanks.

I'm attaching the full size images of the output.....

colo broke

quito

colo fixed

@tmcgee
Copy link
Member

tmcgee commented Mar 1, 2017

@rick-gse thanks for the detailed description of your issue!

At first blush this seems like an issue with the AGS Print Service. If you don't explicitly provide a spatial reference as you did, the spatial reference of the map/basemap will be passed to the service. Here's an example:

"mapOptions": {
    "showAttribution": false,
    "extent": {
        "xmin": -13015085.680169962,
        "ymin": 2663677.561681053,
        "xmax": -8490013.605688732,
        "ymax": 6807175.990962787,
        "spatialReference": {
            "wkid": 102100,
            "latestWkid": 3857
        }
    },
    "spatialReference": {
        "wkid": 102100,
        "latestWkid": 3857
    },
    "scale": 18489297.737236
},

What Print Service are you using - your own or the Esri example?
If your own, what version of AGS?

I suppose also the dpi sent with the request could make a difference but it shouldn't!

@rick-gse
Copy link
Author

rick-gse commented Mar 1, 2017

I am using the default from CMV, the ArcGIS Online one - printTaskURL: 'https://utility.arcgisonline.com/arcgis/rest/services/Utilities/PrintingTools/GPServer/Export%20Web%20Map%20Task',

my client is using their own PrintService on their 10.3 server, but we both have the problem.

And no, the DPI doesn't matter, or the size of the page, or the output type.

@rick-gse
Copy link
Author

rick-gse commented Mar 1, 2017

If I use the Scale Bar widget, it appears on the map correctly, everywhere, without having to specify the spatial reference....

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants