question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

HeatMapWithTime: one time slider across multiple data layers

See original GitHub issue

Please add a code sample or a nbviewer link, copy-pastable if possible

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)

Problem description

Since I am using the same index variable with default time slider parameters for both data layers, I expect the map to only produce one time slider. However, that is not the case as it adds extra time slider for each layer. This becomes an issue when you have let’s say 10 different data layers and 10 identical time sliders on the side of your map.

image

Expected Output

If index variable and time slider parameters are set to be the same across different data layers, the map should only produce one time slider.

Output of folium.__version__

0.7.0

Update

I just found multiple layer example with one time slider using TimestampedWmsTileLayers on nbviewer. How can this be re-created using HeatMapWithTime??

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:11

github_iconTop GitHub Comments

2reactions
kjarus1commented, Feb 18, 2019

Hi, apologies for the late reply but I just wanted to make sure that everything is tested and the code works properly before I write an update.

For my heatmap purposes the code published by @Conengmo works like a charm using this type of set-up:

folium.plugins.HeatMapWithTime(data,overlay=False,name='data',index=index,min_opacity=0.05,radius=20,min_speed=0.1,speed_step=0.1,max_speed=1,max_opacity=1).add_to(heatmap)
HeatMapWithTimeAdditional(data_1,overlay=False,name='data1',min_opacity=0.05,radius=20,max_opacity=1).add_to(heatmap)
HeatMapWithTimeAdditional(data_2,overlay=False,name='data2',min_opacity=0.05,radius=20,max_opacity=1).add_to(heatmap)

I hope this will help other people seeking for similar outcome. Thank you again @Conengmo

0reactions
neha845commented, Jul 19, 2021

I was facing a similar issue and tried to use the code. However when using the HeaMapWithTimeAdditional my Map tile dissapears. Could some one suggest solution?

May be map is zooming more than max_zoom limit of the tile.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Python Folium HeatMapWithTime: one time slider across ...
This becomes an issue when you have let's say 10 different data layers and 10 identical time sliders on the side of your...
Read more >
python-visualization/folium - Map - Gitter
Another problem: Right now, the time slider handles every single row as a separate point on the time slider (so the slider has...
Read more >
Python – Folium Multiple map overlays – iTecNote
But,FeatureGroup() will not seem to work with HeatMapWithTime and adding layers directly to the heatmap results in multiple time sliders on the side...
Read more >
plugins — Folium 0.12.1 documentation - GitHub Pages
Layer. Create a HeatMapWithTime layer. Parameters. data (list of list of ... The outer list corresponds to the various time steps in sequential...
Read more >
How to: Folium for maps, heatmaps & time data | Kaggle
Folium is a tool that makes you look like a mapping God while all the work is done in the back end. It's...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found