rowanwins / leaflet-easyPrint

A leaflet plugin which adds an icon to print the map - Demo @ http://rowanwins.github.io/leaflet-easyPrint/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Issue using custom size and exporting manually

CarlosBustos1 opened this issue · comments

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!

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

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

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

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

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