From 1acf62b6e6ffe18a200c58cf46323dd86e99e16c Mon Sep 17 00:00:00 2001 From: Amir Date: Wed, 9 Feb 2022 01:50:00 +0200 Subject: [PATCH] Reset globalAlpha back to its initial after mutating it for drawing layers --- examples/export-map.js | 1 + examples/export-pdf.js | 1 + 2 files changed, 2 insertions(+) diff --git a/examples/export-map.js b/examples/export-map.js index 060fbcc5c4..56135cdf31 100644 --- a/examples/export-map.js +++ b/examples/export-map.js @@ -98,6 +98,7 @@ document.getElementById('export-png').addEventListener('click', function () { } } ); + mapContext.globalAlpha = 1; if (navigator.msSaveBlob) { // link download attribute does not work on MS browsers navigator.msSaveBlob(mapCanvas.msToBlob(), 'map.png'); diff --git a/examples/export-pdf.js b/examples/export-pdf.js index 000d581653..12163b1340 100644 --- a/examples/export-pdf.js +++ b/examples/export-pdf.js @@ -83,6 +83,7 @@ exportButton.addEventListener( } } ); + mapContext.globalAlpha = 1; const pdf = new jspdf.jsPDF('landscape', undefined, format); pdf.addImage( mapCanvas.toDataURL('image/jpeg'),