leaflet.browser.print icon indicating copy to clipboard operation
leaflet.browser.print copied to clipboard

JS error when manualMode is true

Open techdaddies-kevin opened this issue 2 years ago • 1 comments

Describe the bug When the print control is instantiated with manualMode: true, when clicking the "Print" button that shows up after hitting the print control, a JS error is produced and the document does not print. This is using 2.0.2 Dist version.

To Reproduce Steps to reproduce the behavior:

L.control.browserPrint({
                                printModes: ['Landscape'],
                                closePopupsOnPrint: false,
                                position: 'topright',
                                manualMode: true

                            }).addTo(this.map.canvas);

Expected behavior Printing should work when clicking the print button

Screenshots image image

techdaddies-kevin avatar Sep 13 '22 22:09 techdaddies-kevin

Looking at this with fresh eyes, the bug is obvious.

self.browserPrint._completePrinting(map, origins, objects);

should be

self._completePrinting(map, origins, objects);

in src/leaflet.browser.print.js

techdaddies-kevin avatar Sep 14 '22 12:09 techdaddies-kevin