leaflet-easyPrint
leaflet-easyPrint copied to clipboard
is that possible to print current map in 300 dpi.?
Hi,
I have to print my current map into 300 dpi so I can pint with big size or resolution in the same state.?
Did you figure this out? @mackspidy
Hello,
yes its possible to print in this with 300 DPI
On Tue, Nov 20, 2018 at 12:17 PM Omar Guzman [email protected] wrote:
Did you figure this out? @mackspidy https://github.com/mackspidy
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/rowanwins/leaflet-easyPrint/issues/86#issuecomment-440162918, or mute the thread https://github.com/notifications/unsubscribe-auth/ApfyvoN3SiUBPGUMG0PnTXT10GS_icTBks5uw6VngaJpZM4W3HIu .
--
actually we have to resize it.
@mackspidy can you be more precise please ? Where to resize it ?
Any progress on this?
Here is an ugly work around that I use for a programmatically screenshot trigger.
- It oversize the map.
- Place a leaflet layer in the middle of the map.
- Take the screenshot.
- Reset the old map size.
const width_target = 1920, height_target = 1920;
const printPlugin = L.easyPrint({
exportOnly : true,
hidden : true,
}).addTo(map);
$('#btn_export').click(function (){
let printed = false;
const $divMap = $('#divMap');
const old_width = $divMap.width(), old_height = $divMap.height();
$divMap.animate({'width' : width_target, 'height' : height_target},() => {
map.invalidateSize();
map.fitBounds(myLeafletLayerToFocus);
map.on('moveend', ()=>{
if (printed) return false;
map.on('easyPrint-start', ()=>{
printed = true;
});
map.on('easyPrint-finished', ()=>{
$divMap.width(old_width);
$divMap.height(old_height);
map.fitBounds(myLeafletLayerToFocus);
map.invalidateSize();
});
// *******************************************************
printPlugin.printMap('CurrentSize', 'fileName');
// *******************************************************
});
});
});