New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
HeatMapWithTime: one time slider across multiple data layers #1062
Comments
Hi @kjarus1, I already commented on a related comment of yours. Can you combine your data into a single geojson dictionary? Then create a single The current implementation of |
Hi @Conengmo, thank you very much for getting back to me and offering the solution. One question though: how can I convert my heatmap data into geojson dictionary and then achieve what I want? A simple example would be very useful here and I think it would not only benefit me, especially, those who are not familiar with GeoJSON. Let's say I already converted my pandas dataframe into two list of lists with three columns (lat,lon,weight) representing different datasets:
How can I now plot data_1 layer and data_2 layer using single Thanks, Klaudijus |
Update So far I have tried this but without much success. It seems that
TypeError: object of type 'GeoJson' has no len() |
I'm sorry, I shouldn't be talking about geojson since we're not dealing with those here. My bad. So if I understand correctly you want multiple different heatmaps, each with their own entry in the layer controls, but with a single time control? |
Yes exactly sir! Is there is any way to achieve that? Your help would be much appreciated by not only me, but also my workplace. |
You can do this but not how the code is now. So you need to hack things a bit. If you look in the I just tested a solution where I created a class that only adds additional
You can add these after a
I had some issue with the layer controls, but if you untoggle both and then retoggle them they should appear. If we wanted to add this functionality to folium it would need some work to get it robust. |
Hey @Conengmo thank you very very much for such prompt response and all your help. This is probably a dump question but what do you define in your code as "Layer"? This is the message that I am getting: name 'Layer' is not defined. I tried the following but it fails:
Could it be because I am using a Jupyter Notebook? Found it!
|
Let me know if it works out! I'll close the issue, since I think we don't have anybody to work on implementing this. If somebody comes along who wants to do that, we can of course reopen the issue. PR's are always welcome! |
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:
I hope this will help other people seeking for similar outcome. Thank you again @Conengmo |
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. |
Please add a code sample or a nbviewer link, copy-pastable if possible
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.
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??
The text was updated successfully, but these errors were encountered: