rowanwins / leaflet-easyPrint

A leaflet plugin which adds an icon to print the map - Demo @ http://rowanwins.github.io/leaflet-easyPrint/
MIT License
248 stars 137 forks source link

Failed to execute 'toDataURL' on 'HTMLCanvasElement': Tainted canvases may not be exported. #130

Open RonLibero opened 2 years ago

RonLibero commented 2 years ago

When we use the 'leaflet-groupedlayercontrol' plugin, together with this EasyPrint plugin, we get an error by exporting the image.

 L.easyPrint({
            sizeModes: ['Current', 'A4Landscape', 'A4Portrait'],
            exportOnly: true,
            hideControlContainer: true,
        }).addTo(map);

On click export image, we receive the next console error:

oops, something went wrong! DOMException: Failed to execute 'toDataURL' on 'HTMLCanvasElement': Tainted canvases may not be exported.
    at i3 (https://cityview.test:5173/node_modules/.vite/deps/leaflet-easyprint.js?v=55796427:66:71)

is there anyone who has a solution for this?