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):
Printed map (wrong):
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!
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.
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.