Python Folium HeatMapWithTime:跨多个数据层的一次滑块

时间:2019-02-08 15:01:50

标签: heatmap folium

由于我在两个数据层上都使用具有默认时间滑块参数的相同索引变量,因此我希望HeatMapWithTime仅产生一个时间滑块。但是,事实并非如此,因为它为每个图层添加了额外的时间滑块。当您在地图的侧面上假设有10个不同的数据层和10个相同的时间滑块时,这就会成为问题。

heatmap = folium.Map(location=[0, 0], zoom_start=1.5)
HeatMapWithTime(data_1,index=index,overlay=False).add_to(heatmap)
HeatMapWithTime(data_2,index=index,overlay=False).add_to(heatmap)

Output screenshot: multiple identical time sliders

如果在不同数据层上将索引变量和时间滑块参数设置为相同,那么地图应该只产生一个时间滑块?

更新:

我刚刚在nbviewer上使用TimestampedWmsTileLayers找到了带有一次滑块的多层示例。如何使用HeatMapWithTime重新创建?

1 个答案:

答案 0 :(得分:0)

从一位插件贡献者那里获得了解决此问题的帮助,所需的代码和讨论在github上提供:https://github.com/python-visualization/folium/issues/1062