Center the map in print using leaflet

14 views
Skip to first unread message

Elton Santos

unread,
Nov 30, 2017, 7:14:57 AM11/30/17
to Leaflet

How to solve the problem I show in both images. I have a centered map where I want, when I click to print I would like it to print almost from the screen and reproduce the same position in the print.


However, when I print the map it leaves in a completely different position from the one I want and with more zoom than normal.


What is the best solution to solve this problem? Attached is the two images of the map, one of how it is and another of how it is in the print. I wish they were both alike.


Resumming: How can centralize my map in the print as without print? Attached is the two images: Normal Map and Printing Map .


I need a tutorial or some how fix this, please. I hope you understood, sorry for my english.


For print, I just use:


function imprimirMapa() {
    window
.print();
}



Onclick button


<li class="text-center" onclick="imprimirMapa()">Print</li>

mapa1.png
mapa-print.png
Reply all
Reply to author
Forward
0 new messages