rowanwins / leaflet-easyPrint

A leaflet plugin which adds an icon to print the map - Demo @ http://rowanwins.github.io/leaflet-easyPrint/
MIT License
249 stars 138 forks source link

Error calculating width #71

Closed astridx closed 6 years ago

astridx commented 6 years ago

I display a GPX file on my map using an other plugin. There was an error in this plugin. Because of this error my map was over 1,000,000 pixels wide. That's why I had trouble printing through this plugin.

I have solved the original error now.

Maybe you want to catch such an error here in the plugin too. I helped myself by doing that up to line 32 in the unminifyed bundle.js.

function o(t, e) { return l(t, e || {}).then(function(t) { if (t.width > 3508){ t.width = 3508 } return t.toDataURL() }) }

3508 Pixel is the width if you print landscape with 300 ppi (dpi*).

If you like I open a PR for this.

rowanwins commented 6 years ago

Hi @astridx

Sorry for the very slow reply, thanks for the bug report and fix, I'll add that in and release a patch.