This repository contains a demonstration of how Streamlit can be combined with Folium to create interactive geographic visualizations within a web application.
The demo includes three different scripts, each showcasing a specific integration of Streamlit and Folium:
-
demo.py
A basic example of displaying a simple map using Folium inside a Streamlit application. -
demo2.py
Demonstrates user interaction via Streamlit widgets. Users can select coordinates, and a custom marker is added to the map accordingly. -
demo3.py
Shows how to use Folium to display multiple layers or custom markers, including using GeoJSON coordinates from the Eindhoven open data API and dynamically modifying the map.
Folium is a powerful Python library built on Leaflet.js for creating interactive maps. In this demo, Folium is used to:
- Display maps with markers.
- Add interactive layers (e.g., GeoJSON, popups).
- Dynamically generate map elements based on user input.
Streamlit is a Python framework for building web apps for data science and machine learning. In this project, Streamlit is used to:
- Quickly create a user interface without HTML/CSS.
- Enable interaction via sliders, text fields, and file uploads.
- Embed Folium maps as HTML iframes within the Streamlit app.
-
Install Requirements
First, install the necessary Python packages:pip install streamlit folium
-
Run the Streamlit App Start one of the demos with:
streamlit run demo.py
-
View in Your Browser Streamlit will automatically open the app in your default browser (usually at http://localhost:8501).