Open maka-io opened 6 years ago
Hi @maka-io
Hmmm can you confirm what version of the plugin you are using? And from what I can tell this might be being bundled into a react app or something like that?
Are you using custom sizing or anything like that? A snippet of the plugin config and how you're calling it would be handy.
I am having the same issue. I get the following error:
index.js:141 oops, something went wrong! TypeError: Cannot read property 'width' of undefined
at e._resizeAndPrintMap (index.js:151)
at index.js:138
at <anonymous>
Plugin config:
var printPlugin = L.easyPrint({
title: 'Print',
position: 'bottomleft',
hideControlContainer: false,
sizeModes: ['A4Landscape'],
hidden: false,
}).addTo(map);
Function call:
$('#saveImage').click(function(){
printPlugin.printMap('A4Landscape', 'MyFileName');
});
I am using the latest version of the default branch. Not bundling with React. Thanks.
Thanks for the extended report @ShawnUrbach I'll try and take a look in the next few days
I received the same error as @ShawnUrbach.
The problem: When _resizeAndPrintMap() was called internally via the control it would make a call with sizeMode being the full className "A4Landscape page" whereas calling it programmatically would only be A4Landscape which wouldn't match the preset.
I've added a pull request to resolve the issue.
When this problem will solved ?
This problem still does persist. any fix?
any updates...
Any help? i still had this problem
This works ok when using the buttons on the map, but when calling the printMap method elsewhere has this error: