Skip to content

Dynamization in Folium #1581

Closed
Closed

Description

@Theagainmen

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!

Activity

  1. pstatonwx commented on May 23, 2022

    @pstatonwx

    I would also like this to be added! :)

  2. Conengmo commented on Nov 17, 2022

    @Conengmo
    Member

    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!

  3. pstatonwx commented on Nov 17, 2022

    @pstatonwx
  4. Conengmo commented on Nov 17, 2022

    @Conengmo
    Member

    ipyleaflet is specifically for in Notebooks

  5. pstatonwx commented on Nov 17, 2022

    @pstatonwx
  6. MuhammadQaisarAli commented on Jan 11, 2023

    @MuhammadQaisarAli

    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?

  7. pstatonwx commented on Jan 11, 2023

    @pstatonwx

    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.

  8. MuhammadQaisarAli commented on Jan 11, 2023

    @MuhammadQaisarAli

    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.

  9. pstatonwx commented on Jan 11, 2023

    @pstatonwx

    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.

  10. MuhammadQaisarAli commented on Jan 11, 2023

    @MuhammadQaisarAli

    @pstatonwx thanky very much for your time and concern!

  11. giswqs commented on Jan 11, 2023

    @giswqs
    Contributor

    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

  12. pstatonwx commented on Jan 11, 2023

    @pstatonwx

    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.

  13. giswqs commented on Jan 11, 2023

    @giswqs
    Contributor

    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.

  14. pstatonwx commented on Jan 11, 2023

    @pstatonwx

    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!

  15. MuhammadQaisarAli commented on Jan 11, 2023

    @MuhammadQaisarAli

    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions