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

Map in print not exactly bounded #89

Closed johan14 closed 4 years ago

johan14 commented 4 years ago

Bug

Hi Igor, When printing the map in a certain zoom, only a subset of the map is printed. I checked the bounds using pageBounds of browser-pre-print event, and they were okay. I used landscape mode. I've seen this issue occur also in the examples you've posted.

Screenshots

This is the map.

image

This is the map in print. image

As you can see, the map in print crops pieces both left and right.

Please can you provide me with a solution? Thank you, Johan

Igor-Vladyka commented 4 years ago

Hello Johan,

So for Landscape mode: we are not invalidating bounds, so basically we are getting current map bounds by default, and then center map and print. Why: As you can see the paper dimensions is different from your map(on screen) dimentions, so we cut sides. What to try:

Please try it out and let me know if you need more help and/or information.

johan14 commented 4 years ago

Hi Igor, I tried your second suggestion, and it worked. Thank you very much for your time!