Skip to content

Commit 057aef9

Browse files
Add initial streamlit server
1 parent c6a8877 commit 057aef9

File tree

1 file changed

+45
-5
lines changed

1 file changed

+45
-5
lines changed

hackyeah2024/server.py

+45-5
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,56 @@
33

44
from streamlit_folium import st_folium
55

6+
67
def run_server():
78
st.title('Rowerem przez Małopolskę')
89

10+
cont1 = st.container()
11+
12+
with cont1:
13+
col1, col2 = st.columns(2)
14+
15+
with col1:
16+
st.text_input("Skąd")
17+
18+
with col2:
19+
st.text_input("Dokąd")
20+
21+
cont2 = st.container()
22+
23+
map_bound_coordinates=[
24+
(50.581493, 17.803345),
25+
(50.581493, 22.884521),
26+
(48.915280, 22.884521),
27+
(48.915280, 17.803345),
28+
(50.581493, 17.803345),
29+
]
30+
931
# center on Liberty Bell, add marker
10-
map = folium.Map(location=[39.949610, -75.150282], zoom_start=16)
11-
marker = folium.Marker([39.949610, -75.150282], popup='Liberty Bell', tooltip='Liberty Bell')
12-
marker.add_to(map)
32+
map = folium.Map(
33+
max_bounds=True,
34+
location=[50.049683, 19.944544],
35+
zoom_start=9,
36+
min_lat=48.915280,
37+
max_lat=50.581493,
38+
min_lon=17.803345,
39+
max_lon=22.884521,
40+
tiles='OpenStreetMap'
41+
# min_lon=19.076385,
42+
# max_lon=21.432953,
43+
# min_lat=49.174522,
44+
# max_lat=50.526524
45+
)
46+
marker = folium.Marker([50.049683, 19.944544], popup='Kraków', tooltip='Kraków')
47+
map.add_child(marker)
48+
49+
map_bounds=folium.PolyLine(locations=map_bound_coordinates, weight=5)
50+
51+
map.add_child(map_bounds)
1352

14-
# call to render Folium map in Streamlit
15-
st_data = st_folium(map, width=725)
53+
with cont2:
54+
# call to render Folium map in Streamlit
55+
st_data = st_folium(map, width=725)
1656

1757

1858
if __name__ == '__main__':

0 commit comments

Comments
 (0)