Brainstorming - leafmaps without re-rendering on recalculation

Summary

Hello, streamlit community! I’m trying to figure out how to make my app’s user experience better. Any ideas how to define a leafmap with an added shape file, using a geodataframe, in a way that does not require map rendering on recalculation? I’ve tried using session states, but without satisfying results. Please note that I want to color certain counties taking into account parameters from text input, triggering recalculation.

Btw. is

    m = leafmap.Map()
    m.add_gdf(gdf, layer_name="JPT_NAZWA_")

    (...)

    m.add_gdf(
        gdf.loc[[st.session_state["r_no_col"]]],
        layer_name="Selected",
        fill_colors=["red"],
    )
    m.to_streamlit()

Streamlit app

Please note that it takes some time to load & render map

https://powiaty.streamlit.app/

Github

1 Like

Did you see this post? Maybe it will help?

1 Like

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.