junjiez / streamlit-folium

Streamlit Component for rendering Folium maps

Home Page:https://share.streamlit.io/randyzwitch/streamlit-folium/examples/streamlit_app.py

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

streamlit-folium

Run tests each PR

Open in Streamlit

This Streamlit Component is a work-in-progress to determine what functionality is desirable for a Folium and Streamlit integration. Currently, one method folium_static() is defined, which takes a folium.Map or folium.Figure object and displays it in a Streamlit app.

Installation

pip install streamlit-folium

Example

import streamlit as st
from streamlit_folium import folium_static
import folium

"# streamlit-folium"

with st.echo():
    import streamlit as st
    from streamlit_folium import folium_static
    import folium

    # center on Liberty Bell
    m = folium.Map(location=[39.949610, -75.150282], zoom_start=16)

    # add marker for Liberty Bell
    tooltip = "Liberty Bell"
    folium.Marker(
        [39.949610, -75.150282], popup="Liberty Bell", tooltip=tooltip
    ).add_to(m)

    # call to render Folium map in Streamlit
    folium_static(m)

"streamlit_folium example"

About

Streamlit Component for rendering Folium maps

https://share.streamlit.io/randyzwitch/streamlit-folium/examples/streamlit_app.py

License:MIT License


Languages

Language:TypeScript 70.8%Language:Python 25.2%Language:HTML 3.3%Language:Shell 0.7%