rowanwins / leaflet-easyPrint

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

Issue using custom size and exporting manually #98

Open CarlosBustos1 opened 5 years ago

CarlosBustos1 commented 5 years ago

Hello, if I export a map via easy.Print control with custom size everything works fine, but if I export manually an error ocurr: index.js:110 Uncaught TypeError: Cannot read property 'className' of undefined at e.printMap (index.js:110) at manualPrint (index.html:104) at HTMLButtonElement.onclick (index.html:111)

Here is what I have: jsFiddle

This is my custom size options: var mapSizeOption = { width: 1500, height: 1000, className: 'a3CssClass', tooltip: 'Export map' }

easy control: var printer = L.easyPrint({ tileLayer: tiles, tileWait:1500, sizeModes: [mapSizeOption], filename: 'myMap', exportOnly: true, hideControlContainer: true }).addTo(map);

and to export manually: printer.printMap(mapSizeOption, 'MyManualPrint')

Thanks for your excelent job!

micabrunel commented 5 years ago

@CarlosBustos1 Any news about it ? Any help ? I have the same problem...

CarlosBustos1 commented 5 years ago

@CarlosBustos1 Any news about it ? Any help ? I have the same problem...

Hello @micabrunel , I do not have any solution for the problem.

zzhenryquezz commented 3 years ago

I think you have to pass the className of custom size in the printMap() function, it works for me

printer.printMap('a3CssClass', 'MyManualPrint')