Skip to content

Commit

Permalink
Add clarifying comments
Browse files Browse the repository at this point in the history
  • Loading branch information
perliedman committed Aug 29, 2022
1 parent b0464ae commit 4c4ae32
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/services/print.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,12 @@ export async function printCourse(
const projectedExtent = transformExtent(printAreaExtent, ([x, y]) =>
toProjectedCoord(crs, [x, y])
);
const scaleFactor = crs.scale / course.printScale;
// Print area in millimeters in map's original scale
const printAreaWidthMm = printAreaExtent[2] - printAreaExtent[0];
const printAreaHeightMm = printAreaExtent[3] - printAreaExtent[1];
// The scale factor between map's original scale and the requested print scale
const scaleFactor = crs.scale / course.printScale;
// Output dimensions in pt on the actually printed paper (in print scale)
const outputWidthPt = printAreaWidthMm * scaleFactor * mmToPt;
const outputHeightPt = printAreaHeightMm * scaleFactor * mmToPt;
const mapSvg = tiler.renderSvg(projectedExtent, 1, svgOptions);
Expand Down

0 comments on commit 4c4ae32

Please sign in to comment.