grinat / leaflet-simple-map-screenshoter

Leaflet plugin which take screenshot of map
MIT License
71 stars 19 forks source link

FitBounds + takescreen results in corrupted Image. #27

Closed Daddelion closed 2 years ago

Daddelion commented 2 years ago

As you can see. When I execute map.fitBounds(layer.getBounds()). This is the resulting Image.

git

Is this a waiting issue? I tried waiting for "zoomend" but that didn't help.

grinat commented 2 years ago

@Daddelion I think the problem is in the layout. Try to remove/change some css properties. For exam: https://github.com/grinat/leaflet-simple-map-screenshoter/issues/24#issuecomment-881563764

Daddelion commented 2 years ago

I don't really think so. I believe this happens, because it is not finished with the panning/zooming. When I put the takescreen on a separate button instead of the same function. It works. But I cannot get the takescreen function to wait.

Daddelion commented 2 years ago

Here look at this jsfiddle: https://jsfiddle.net/uk3nfegb/11/

  1. draw a Polygon
  2. press the button on top.
  3. scroll down to see the image
grinat commented 2 years ago

@Daddelion fixed in 0.4.5

Daddelion commented 2 years ago
  1. when it zooms it does not wait for the tiles to reload so it really lucks not good. image

  2. sadly when it does a larger zoom, from zoom 3-10 sometime still happens, but its hard to reproduce :/ sorry image

https://jsfiddle.net/458xac6m/

  1. draw a SMALL Polygon (so it zooms a lot)
  2. press the button on top.
  3. scroll down to see the image

@grinat Should i open a new issue?