gmaps
gmaps copied to clipboard
Any way to export PNGs in python?
I kind of want to export my plot (a few dozens) in PNG, and the default viewport is OK. Hitting the "Download" button again and again is really slow.
Thanks for raising an issue! In the future, it's probably worth not using words like 'dumb' though.
As a workaround, you can simulate a click through your browser's JavaScript console with, e.g.:
$('.fa-download').click()
This will click on every gmaps download button that is currently rendered. Note that the download won't work if the maps are not actually visible on the screen, in which case you might be able to do something clever about scrolling to see the buttons.
There is currently no way to export PNGs from Python, but PRs welcome. One significant bit of complexity (maybe insurmountable) comes from the fact that, AFAICT, the view needs to actually be visible on the screen for html2canvas to work.
For anyone interested in doing this, I suggest trying this out.
- creating a method on the
Map(orFigure) class. This method would send a custom message to the client. - The JavaScript model (or the views) would catch the message and trigger the export to PNG method.
Would be great to see this feature, I also want to download a lot of images, so doing it by hand will be hard