Is there any way to Hide Folium Map On Button Click

I am trying to hide a map on a click of a button. is there any option available?

Hi @Apoorv_Salaria,

Thanks for sharing this question!

Do you have example code to share?

I would use the st.toggle element to hide or unhide the map. Something like this for example:

import streamlit as st
import folium
from streamlit_folium import folium_static

on = st.toggle('Show map')

if on:

Hey @tonykip Thanks for helping… I’ll tried this method. It helps

Glad you found it helpful. Happy Streamlit-ing!

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