We have gwt webapplication, showing map, implemented with gwt-openlayers.
I would like to implement a function to export the current map as an image (for example png).
I'm aware of this example from openlayers, but I struggle getting it done with gwt.
https://openlayers.org/en/latest/examples/export-map.html
Help would be appreciated
After more trial & error I found this solution which partly solves my problem: https://stackoverflow.com/a/25486443/6919820
However, after closing the print dialog, the printed layout remains as some kind of overlay on my previous window. So my approach was to create a new map and copy all relevant data from the original one. Then print the new map and destroy it afterwards.
It works, but I'm not convinced by my approach. Maybe there are better ways to do it.