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

Can't get print mode: custom to work with custom buttons #86

Closed JIsbak closed 4 years ago

JIsbak commented 4 years ago

Describe the bug When using the custom print button functionality I can't get the print mode: custom to work. It automatically print without letting me select an area. When I use the build in controls, everything is working as it should.

To Reproduce

L.control.browserPrint({
            position: 'bottomleft',
            closePopupsOnPrint: false,
            printModes: ["Portrait", "Landscape", "Auto", "Custom"],
            manualMode: false
        }).addTo(this.map);

And then the following in the custom button:

var modeToUse = L.control.browserPrint.mode.custom();
this.map.printControl.print(modeToUse);

Expected behavior Should work as when using the build in controls.

Desktop (please complete the following information):

Igor-Vladyka commented 4 years ago

Hello,

Thanks for noticing it. It was fixed in last version 1.0.5. Please take a look and let me know if any.

Regards, Igor

JIsbak commented 4 years ago

Hi Igor,

I works👍 Thank you for the quick feedback!

Cheers, Jens