我尝试使用ipyleaflet导出数据可视化为PNG或其他文件格式,但是找不到有效的方法。例如,在folium中有map.save(path)。在我的研究中,是否有ipyleaflet库或方法被我忽略了,可以帮助我达成目标?
这里是生成地图的示例代码
from ipyleaflet import *
center = [34.6252978589571, -77.34580993652344]
zoom = 10
m = Map(default_tiles=TileLayer(opacity=1.0), center=center, zoom=zoom)
m
我想以图像文件的形式导出此地图,而不需要手动截屏。
我发现两个可以导出 Javascript Leaflet 地图的资源: https://github.com/aratcliffe/Leaflet.print 和 https://github.com/mapbox/leaflet-image
不幸的是,我无法在 Python 中使用它们。
data
是什么?谢谢 - denis