Leaflet.Export icon indicating copy to clipboard operation
Leaflet.Export copied to clipboard

Trying to download canvas as svg+xml returns me a file that's a png.

Open Skul-gun opened this issue 7 years ago • 1 comments

I have a project with a map page. I loaded this plugin and html2canvas on the page so I could try and export the map as a .svg file. I used the following command in the console

map.downloadExport({container: map._container, format:"image/svg+xml", fileName: "map.svg"})

It does download a file called map.svg, but upon opening it, it turns out the file is actually a .png file. Is there anything I'm doing wrong or is it an issue with the library itself?

Skul-gun avatar May 24 '18 15:05 Skul-gun

I think your canvas does not support svg. Try using supportedCanvasMimeTypes() to find out.

BernardTeske avatar Jul 31 '18 06:07 BernardTeske