Problem moving map

10 views
Skip to first unread message

Luca Bertoncello

unread,
Apr 10, 2022, 11:16:27 AMApr 10
to leafl...@googlegroups.com
Hi list!

I'm writing a program to export the map as PDF.
To do that I retrieve a screenshot (using
https://github.com/grinat/leaflet-simple-map-screenshoter) of small
parts of the whole map, then move to the next part and so on.

It works, but I have a little problem and I really don't know why it
happens...

I move the map with this code:

c = icaoMap.getCenter();
b = icaoMap.getBounds();
if(b.getEast() < routeBounds.east)
{
// Move to east
w = b.getEast() - b.getWest();
icaoMap.panTo(new L.LatLng(c.lat, c.lng + w));
partCol++;
}
else if(b.getSouth() > routeBounds.south)
{
// Back to the west point and move to south
h = b.getNorth() - b.getSouth();
icaoMap.panTo(new L.LatLng(c.lat - h, startLng));
partRow++;
partCol = 1;
}

As I said, it works, but moving the map to south does not move the
"complete height of the map", but just a part (let say 99,9%), see the
screenshot.

Can someone explain me why the problem happens and how can I do to solve it?

Thanks
Luca
m.png
Reply all
Reply to author
Forward
0 new messages