Igor-Vladyka / leaflet.browser.print

A leaflet plugin which allows users to print the map directly from the browser
https://igor-vladyka.github.io/leaflet.browser.print/
MIT License
154 stars 76 forks source link

JS error when manualMode is true #119

Open techdaddies-kevin opened 1 year ago

techdaddies-kevin commented 1 year ago

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 commented 1 year ago

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