I absolutely love react-leaflet! I'm using it to produce basemaps for weather alerts on a next.js driven site. My company requires that the server is on the Intranet only. Therefore, for employees outside of the company, I'm sending an e-mail for specific alerts and would like to include a PNG attached image of the map with the alert features. I've dived into leaflet.print and leaflet.image but all seem to require human interaction to press a button in order to save the image. I'd like this done automatically when the alerts are e-mailed to the recipients. I understand that having a View/DOM (Browser) might be necessary. However, for automation reasons, I'd probably want this to happen on the backend (node.js). Is there anything out there that could possibly do what I'm looking for or, is the need for a DOM/View going to make it difficult or impossible? Thanks in advance. I usually try to research as much as I can before asking a potentially repetitive question, but I'm stuck here
Asked
Active
Viewed 598 times
0

Chris Jarzynka
- 11
- 2
-
I'm not too familiar with next.js at this point, but have you looked into [leaflet-simple-map-screenshoter](https://github.com/grinat/leaflet-simple-map-screenshoter)? It has the capability to programatically take snapshots by calling `simpleMapScreenshoter.takeScreen`, and it can be used with a react-leaflet map pretty easily. It does rely heavily on the DOM, so I'm not sure how that's gonna fly with next.js. – Seth Lutske Apr 14 '21 at 21:58
-
@SethLutske thank you! I'll check it out! – Chris Jarzynka Apr 15 '21 at 22:17