4
4
from streamlit_folium import st_folium
5
5
6
6
7
+ def plot_route (map , route_pts ):
8
+ route = folium .PolyLine (locations = route_pts , weight = 2 )
9
+ map .add_child (route )
10
+ return map
11
+
12
+
7
13
def run_server ():
8
14
st .title ('Rowerem przez Małopolskę' )
9
15
@@ -21,27 +27,23 @@ def run_server():
21
27
cont2 = st .container ()
22
28
23
29
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 ),
30
+ (50.526524 , 19.076385 ),
31
+ (50.526524 , 21.432953 ),
32
+ (49.174522 , 21.432953 ),
33
+ (49.174522 , 19.076385 ),
34
+ (50.526524 , 19.076385 ),
29
35
]
30
36
31
37
# center on Liberty Bell, add marker
32
38
map = folium .Map (
33
39
max_bounds = True ,
34
- location = [50.049683 , 19.944544 ],
40
+ location = [0.5 * ( 49.174522 + 50.526524 ), 0.5 * ( 19.944544 + 21.432953 ) ],
35
41
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
42
+ tiles = 'OpenStreetMap' ,
43
+ min_lon = 19.076385 ,
44
+ max_lon = 21.432953 ,
45
+ min_lat = 49.174522 ,
46
+ max_lat = 50.526524
45
47
)
46
48
marker = folium .Marker ([50.049683 , 19.944544 ], popup = 'Kraków' , tooltip = 'Kraków' )
47
49
map .add_child (marker )
0 commit comments