Select to view content in your preferred language

Points of printed webmap are displayed wrong

2201
2
01-13-2016 02:20 AM
MatthiasGerke1
New Contributor

I have a problem when printing a webmap with the javascript api for arcgis. The printTask function is working correct but the points of the printed map are displayed different to the webmap.

Webmap (correct):

Webmap.PNG

Printed map (wrong):

PrintedMap.PNG

The renderer of the pointLayer uses the sizeInfo attribut which represents a distance quantity:

var sizeInfo = {
            field: function (graphic) {
                var caseCount = getCaseCountByAssigneeIds(graphic.attributes["assigneeIds"]);

                if (caseCount) {
                    return 50 * Math.sqrt(caseCount) / 3;
                } else {
                    return 0;
                }
            },
            valueUnit: "meters",
            valueRepresentation: "radius",
        };

Here the print command:

var printTask = new PrintTask("..");

var params = new PrintParameters();
params.map = map;
params.outSpatialReference = map.spatialReference;

var template = new PrintTemplate();
template.exportOptions = {
    width: 1280,
    height: 720,
    dpi: 300
};
template.format = "pdf";
template.layout = "A3 Landscape";
template.preserveScale = true;
template.layoutOptions = {
    scalebarUnit: "Kilometers",
    legendLayers: []
};

params.template = template;

printTask.execute(params, function (res) {
    window.open(res.url);
}, function (err) {
    debugger;
});

It seems the valueUnit (meters) will be not converted correct. Any ideas? Did i forgot settings?

Thanks for help!

0 Kudos
2 Replies
XanderBakker
Esri Esteemed Contributor

Just a question... what happens if you use 96dpi (screen resolution) does that change the size of the symbols in the exported map?

As an alternative you could create polygons (buffer the points) the printed map will conserve the areas in that case.

0 Kudos
MatthiasGerke1
New Contributor

Thanks for your answer! It happens nothing if i set dpi to 96!

To create polygons as buffers could be a good workaround. But the problem is unfortunately still there, i don`t understand why the meters can not be interpreted as unit when printing.

0 Kudos