I have a rails website where people can create custom maps using Leaflet JS. When they share those maps, I want the preview image to be an image of that map.
Right now, when a users map updates, I cache the GeoJSON that defines their map look. When I cache that GeoJSON, I would also like to grab an image of their map and save it to S3 so I can use it when they share their map.
The problem is, all the plugins I've found are designed for the user to capture their own image. Since leaflet runs in the browser, is there an easy way to capture this image, or do I need to setup a server hosted version of Leaflet?