Selective Coloring in st.map( ) function

So I’m using st.map( ) to highlight those specific cities with a population threshold more than 700,000. However, is there a way to change the colors of these points? Let’s assume I wanna demarcate cities with population >= 700,000 and cities with population <= 700,000 with different colors, how do I achieve this?
The code I’m using is : st.map(India.query(“population >= 700000”)[[“latitude”,“longitude”]].dropna(how=“any”))

India is my dataset which contains city name, latitude, longitude and the population of that particular city.

Hi @ritwik_lal, welcome to the Streamlit community!

It’s important to note that st.map() is a convenience function for quickly plotting on a map. If you want to be more involved, there are several choices.

Within Streamlit, there’s a second function st.pydeck_chart that allows you to write a Deck.gl specification through Python to create customized layers:

https://docs.streamlit.io/en/stable/api.html#streamlit.pydeck_chart

Additionally, I just released a Streamlit Component for Folium:

https://python-visualization.github.io/folium/

Best,
Randy

Thank you very much. Will surely check it out :slight_smile:

1 Like