I am new in LeafletJS. I am trying to print map in LeafletJS. My code for print is like this:
printProvider = L.print.provider({
capabilities: printConfig,
method: 'GET',
dpi: 254,
autoLoad: true,
// outputFormat: 'pdf',
customParams: {
mapTitle: 'Print Test',
comment: 'Testing Leaflet printing'
}
});
// Create a print control with the configured provider and add to the map
printControl = L.control.print({
provider: printProvider
});
map.addControl(printControl);
But when I click the print button error comes like this
Proxy Error.
The proxy server received an invalid response from an upstream server.
The proxy server could not handle the request GET /mapfish-print/pdf/print.pdf.
Reason: Error reading from remote server
Can anyone help me?
You can use jQuery Plugin to print a map.
The code is as simple as
$('#map').print();
Here is the codepen.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With