1

Like the title says, I'm building a webgis using Leaflet. I want to allow users to export maps from the website and download them, but the current downloaded format is shapefile. I wonder if there's a configuration that enables export format as pdf.

As it may be related, the maps only show the regions in which data are visualized and hide the rest of Leaflet base map. Can you tell if this configuration will be preserved in pdf exported outputs?

  • which map server are you using? – Ian Turton Dec 31 '15 at 10:44
1

I wonder if there's a configuration that enables export format as pdf.

No. Leaflet does nothing of the likes of that.

If you want PDFs, you'll need to print PDFs. You can let the users do just that with their web browsers - but if you really need the users to download PDFs, then you can run tools like wkhtmltopdf or a PahtomJS script server-side to generate those PDF files. These work by creating headless (server-less) web browsers and opening your webapp.

1

You can also just export the dom element as a pdf/png.
Here is a threed that works with openLayers. But should be the same with leaflet
Follow here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.