is that possible to print current map in 300 dpi.?
mackspidy opened this issue · comments
mackspidy commented
Hi,
I have to print my current map into 300 dpi so I can pint with big size or resolution in the same state.?
Omar Guzman commented
Did you figure this out? @mackspidy
mackspidy commented
Hello,
yes its possible to print in this with 300 DPI
…On Tue, Nov 20, 2018 at 12:17 PM Omar Guzman ***@***.***> 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
<#86 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ApfyvoN3SiUBPGUMG0PnTXT10GS_icTBks5uw6VngaJpZM4W3HIu>
.
--
mackspidy commented
actually we have to resize it.
Michael Brunel commented
@mackspidy can you be more precise please ? Where to resize it ?
Tomáš Dvořák commented
Any progress on this?
Florian CAVASIN commented
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');
// *******************************************************
});
});
});