rowanwins / leaflet-easyPrint

A leaflet plugin which adds an icon to print the map - Demo @ http://rowanwins.github.io/leaflet-easyPrint/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

RonLibero opened this issue · comments

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?