Generate screenshot of map

Kenyo Joel picture Kenyo Joel · Oct 7, 2015 · Viewed 7.1k times · Source

How can I generate a image of a div, the div contain a map of leaflet (base layers, overlays)?

Screenshot_Leaflet_Div

Answer

snkashis picture snkashis · Oct 8, 2015

Mapbox's leaflet-image plugin will allow you to kick out an image file of your map container clientside.Enabling canvas mode is required, as seen in their instructions. A more involved server-side approach would include the use of Mapfish/Geoserver and a leaflet plugin, which has a lot more flexibility, but also a lot more configuration.