有可能在bokeh仪表板中添加一个folium地图吗?从本质上讲,使其中一个仪表板小部件成为一个folium地图



另一个选项是使用bokeh的gmap((函数,但如果地址已经进行了地理编码,那么可以自由使用吗?使用gmap((函数需要一个google API键,但我不确定ti涉及的财务影响。

p = gmap("GOOGLE_API_KEY", map_options, title="Title")

编辑:

我能够使用以下代码将一个folium地图添加到Bokeh仪表板中。它使用一个DIV Bokeh小部件,并在该小部件中插入一个iframe:

from bokeh.models import Div
output_file('dashboardWithFoliumMap.html')
mapa = Div(text="<iframe src="r'D:MapFolderMapsmyMap.html'" style='min-width:calc(100vw - 26px); height: 500px'><iframe>")
show(mapa)

用于在Bokeh Dashboard、中嵌入薄层图

  1. 使用folium库创建交互式Map应用程序,并将其保存为典型的html文档。例如:'imap.html'
  2. 如上所示,使用bokeh的Div将"imap.html"嵌入到您的面板中

最新更新