Skip to content

Commit 40e98d6

Browse files
committed
Improve README example
1 parent 173a555 commit 40e98d6

File tree

4 files changed

+43
-2
lines changed

4 files changed

+43
-2
lines changed

README.md

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,24 @@ import streamlit as st
1515
from streamlit_folium import folium_static
1616
import folium
1717

18-
m = folium.Map(location=[45.5236, -122.6750])
19-
folium_static(m)
18+
"# streamlit-folium"
19+
20+
with st.echo():
21+
import streamlit as st
22+
from streamlit_folium import folium_static
23+
import folium
24+
25+
# center on Liberty Bell
26+
m = folium.Map(location=[39.949610, -75.150282], zoom_start=16)
27+
28+
# add marker for Liberty Bell
29+
tooltip = "Liberty Bell"
30+
folium.Marker(
31+
[39.949610, -75.150282], popup="Liberty Bell", tooltip=tooltip
32+
).add_to(m)
33+
34+
# call to render Folium map in Streamlit
35+
folium_static(m)
2036
```
2137

2238
!["streamlit_folium example"](_static/streamlit_folium_example.png)
72.2 KB
Loading

examples/requirements.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
streamlit>=0.63
2+
streamlit-folium
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
import streamlit as st
2+
from streamlit_folium import folium_static
3+
import folium
4+
5+
"# streamlit-folium"
6+
7+
with st.echo():
8+
import streamlit as st
9+
from streamlit_folium import folium_static
10+
import folium
11+
12+
# center on Liberty Bell
13+
m = folium.Map(location=[39.949610, -75.150282], zoom_start=16)
14+
15+
# add marker for Liberty Bell
16+
tooltip = "Liberty Bell"
17+
folium.Marker(
18+
[39.949610, -75.150282], popup="Liberty Bell", tooltip=tooltip
19+
).add_to(m)
20+
21+
# call to render Folium map in Streamlit
22+
folium_static(m)
23+

0 commit comments

Comments
 (0)