Skip to content
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

Dynamization in Folium #1581

Closed
Theagainmen opened this issue Apr 7, 2022 · 15 comments
Closed

Dynamization in Folium #1581

Theagainmen opened this issue Apr 7, 2022 · 15 comments

Comments

@Theagainmen
Copy link

Describe the solution you'd like
I would like to update marker data live based on actual data. Same goes for the data in the marker pop-up. I would also like to draw circles and maybe add or remove markers based on live data.

Describe alternatives you've considered
Writing in JavaScript with Leaflet.js itself, but my JavaScript is not good.

Additional context
Maybe there is already another Python package that supports this, but I do not think so, if there is I would appreciate if anyone could let me know!

Implementation
I am not sure how this could be implemented, since my Python and JavaScript knowledge is limited.

Thanks for developing Folium, makes it a lot easier to use for non JavaScript people!

@pstatonwx
Copy link

I would also like this to be added! :)

@Conengmo
Copy link
Member

Conengmo commented Nov 17, 2022

Check out https://github.com/jupyter-widgets/ipyleaflet which is much more dynamic than folium.

There's also this discussion: #848

And this one: #906

Hope it helps!

@pstatonwx
Copy link

pstatonwx commented Nov 17, 2022 via email

@Conengmo
Copy link
Member

ipyleaflet is specifically for in Notebooks

@pstatonwx
Copy link

pstatonwx commented Nov 17, 2022 via email

@MuhammadQaisarAli
Copy link

Okay - I am developing an application that is not using a Jupyter Notebook - thank you for the suggestion anyway!

On Thu, Nov 17, 2022 at 10:45 AM Frank @.> wrote: ipyleaflet is specifically for in Notebooks — Reply to this email directly, view it on GitHub <#1581 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/AXPJQ7DMUSI5VPQDVXXYBR3WIZHIPANCNFSM5S2GNECA . You are receiving this because you commented.Message ID: @.>
-- Patrick Staton | Weather Product Engineer c: 304-888-2595 e: @.***

Well, I am doing the same. But facing same issues, @pstatonwx any luck?

@pstatonwx
Copy link

Okay - I am developing an application that is not using a Jupyter Notebook - thank you for the suggestion anyway!

On Thu, Nov 17, 2022 at 10:45 AM Frank @.> wrote: ipyleaflet is specifically for in Notebooks — Reply to this email directly, view it on GitHub <#1581 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/AXPJQ7DMUSI5VPQDVXXYBR3WIZHIPANCNFSM5S2GNECA . You are receiving this because you commented.Message ID: _@**._>
-- Patrick Staton | Weather Product Engineer c: 304-888-2595 e: _
@_.*

Well, I am doing the same. But facing same issues, @pstatonwx any luck?

Nope :( It looks like we're out of luck on this front.

@MuhammadQaisarAli
Copy link

Okay - I am developing an application that is not using a Jupyter Notebook - thank you for the suggestion anyway!

On Thu, Nov 17, 2022 at 10:45 AM Frank @.> wrote: ipyleaflet is specifically for in Notebooks — Reply to this email directly, view it on GitHub <#1581 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/AXPJQ7DMUSI5VPQDVXXYBR3WIZHIPANCNFSM5S2GNECA . You are receiving this because you commented.Message ID: _@**._>
-- Patrick Staton | Weather Product Engineer c: 304-888-2595 e: _
@_.*

Well, I am doing the same. But facing same issues, @pstatonwx any luck?

Nope :( It looks like we're out of luck on this front.

Sorry to hear that. Any alternate ways adopted?.
I am trying to move the maker on map without re-rendering/refreshing of map in Python application, (developed in Qt6). I have used folium but the problem is that each time tha map has to be rendered, when the marker moves, and then has to be plotted/viewed in HTML. That causes the flashing of screen. I am wondering how this would be done in softweares like mission planner, goolge and careem etc?

Thank you @pstatonwx for your repsone.

@pstatonwx
Copy link

Okay - I am developing an application that is not using a Jupyter Notebook - thank you for the suggestion anyway!

On Thu, Nov 17, 2022 at 10:45 AM Frank @.> wrote: ipyleaflet is specifically for in Notebooks — Reply to this email directly, view it on GitHub <#1581 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/AXPJQ7DMUSI5VPQDVXXYBR3WIZHIPANCNFSM5S2GNECA . You are receiving this because you commented.Message ID: _@**._>
-- Patrick Staton | Weather Product Engineer c: 304-888-2595 e: _
@_.*

Well, I am doing the same. But facing same issues, @pstatonwx any luck?

Nope :( It looks like we're out of luck on this front.

Sorry to hear that. Any alternate ways adopted?. I am trying to move the maker on map without re-rendering/refreshing of map in Python application, (developed in Qt6). I have used folium but the problem is that each time tha map has to be rendered, when the marker moves, and then has to be plotted/viewed in HTML. That causes the flashing of screen. I am wondering how this would be done in softweares like mission planner, goolge and careem etc?

Thank you @pstatonwx for your repsone.

Unfortunately that is what I have found as well, there's no way to dynamically add/remove content with Python/Folium. The only other way would be to use JavaScript to make an actual Leaflet map.

@MuhammadQaisarAli
Copy link

@pstatonwx thanky very much for your time and concern!

@giswqs
Copy link
Contributor

giswqs commented Jan 11, 2023

If you are looking for a Python solution outside Jupyter notebook, Streamlit pydeck chart kind of allows adding and removing layers without refreshing the entire map.
https://docs.streamlit.io/library/api-reference/charts/st.pydeck_chart

@pstatonwx
Copy link

If you are looking for a Python solution outside Jupyter notebook, Streamlit pydeck chart kind of allows adding and removing layers without refreshing the entire map. https://docs.streamlit.io/library/api-reference/charts/st.pydeck_chart

Thanks! I can't completely speak for @MuhammadQaisarAli , but at least for me, I'm only adding/removing polygons on a map, not entire layers. Is this something that Streamlit pydeck chart could achieve?

For instance, mine is a weather application displaying warnings - if a tornado warning is issued, I need the polygon for the affected area to pop up on my Folium map, and then when it expires, it needs to disappear. In the current framework, this requires a full page refresh.

@giswqs
Copy link
Contributor

giswqs commented Jan 11, 2023

Yes, I believe so. I did that before using streamlit pydeck chart. It can add/remove layers dynamically without refreshing the entire map, kind of like ipyleaflet for Jupyter notebook.

@pstatonwx
Copy link

Yes, I believe so. I did that before using streamlit pydeck chart. It can add/remove layers dynamically without refreshing the entire map, kind of like ipyleaflet for Jupyter notebook.

Okay thanks!

@MuhammadQaisarAli
Copy link

If you are looking for a Python solution outside Jupyter notebook, Streamlit pydeck chart kind of allows adding and removing layers without refreshing the entire map. https://docs.streamlit.io/library/api-reference/charts/st.pydeck_chart

Thank you Professor @giswqs . I will have a try to this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants