Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -4,16 +4,16 @@ from streamlit_folium import folium_static
|
|
4 |
|
5 |
# Define mythological places data for Iceland
|
6 |
mythological_places = [
|
7 |
-
('Ásbyrgi', 66.0082, -16.5096),
|
8 |
-
('Dimmuborgir', 65.6083, -16.8996),
|
9 |
-
('Hekla', 63.9920, -19.6656),
|
10 |
-
('Elliðaey', 63.4845, -20.2785),
|
11 |
-
('Mývatn', 65.6039, -16.9965),
|
12 |
-
('Djúpalónssandur', 64.7439, -23.9033),
|
13 |
-
('Reykjadalur', 64.0333, -21.2167),
|
14 |
-
('Snaefellsjokull', 64.8080, -23.7767),
|
15 |
-
('Jokulsarlon', 64.0784, -16.2300),
|
16 |
-
('Vatnajokull', 64.4150, -16.8333)
|
17 |
]
|
18 |
|
19 |
# Create a map centered on Iceland
|
@@ -23,7 +23,7 @@ m = folium.Map(location=[65.0, -18.0], zoom_start=7)
|
|
23 |
for place in mythological_places:
|
24 |
folium.Marker(
|
25 |
location=[place[1], place[2]],
|
26 |
-
popup=f'{place[0]}',
|
27 |
icon=folium.Icon(color='red')
|
28 |
).add_to(m)
|
29 |
|
@@ -32,15 +32,14 @@ def update_map(place_data):
|
|
32 |
m.location = [place_data[1], place_data[2]]
|
33 |
m.zoom_start = 13
|
34 |
folium_static(m)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
35 |
|
36 |
-
# Create a grid of buttons for selecting mythological places
|
37 |
-
for i in range(0, len(mythological_places), 3):
|
38 |
-
cols = st.columns(3)
|
39 |
-
for j in range(3):
|
40 |
-
if i + j < len(mythological_places):
|
41 |
-
with cols[j]:
|
42 |
-
if st.button(mythological_places[i + j][0]):
|
43 |
-
update_map(mythological_places[i + j])
|
44 |
|
45 |
-
|
46 |
-
folium_static(m)
|
|
|
4 |
|
5 |
# Define mythological places data for Iceland
|
6 |
mythological_places = [
|
7 |
+
('Ásbyrgi', 66.0082, -16.5096, 'Ásbyrgi is a horseshoe-shaped canyon, believed to have been formed by the hoof of Odin\'s eight-legged horse, Sleipnir.'),
|
8 |
+
('Dimmuborgir', 65.6083, -16.8996, 'Dimmuborgir, or "Dark Cities," is a lava field with dramatic rock formations. It is said to be the dwelling of trolls and elves.'),
|
9 |
+
('Hekla', 63.9920, -19.6656, 'Hekla is a stratovolcano believed to be the gateway to hell in the Middle Ages. It was also rumored to be a meeting place for witches.'),
|
10 |
+
('Elliðaey', 63.4845, -20.2785, 'Elliðaey is an isolated island, where, according to legend, a mythical monster called the skoffin, a hybrid of a cat and a fox, is said to have lived.'),
|
11 |
+
('Mývatn', 65.6039, -16.9965, 'Mývatn is a volcanic lake surrounded by unique geological formations. The area is steeped in folklore and is said to be home to various supernatural beings.'),
|
12 |
+
('Djúpalónssandur', 64.7439, -23.9033, 'Djúpalónssandur is a black sand beach, where, according to legend, a supernatural seal woman appeared and was captured by a fisherman.'),
|
13 |
+
('Reykjadalur', 64.0333, -21.2167, 'Reykjadalur, or "Steam Valley," is a geothermal area with hot springs. It is believed to be the home of hidden people, who live in the rocks and hills.'),
|
14 |
+
('Snaefellsjokull', 64.8080, -23.7767, 'Snaefellsjokull is a glacier-capped volcano that inspired Jules Verne\'s "Journey to the Center of the Earth." It is believed to hold mystical powers.'),
|
15 |
+
('Jokulsarlon', 64.0784, -16.2300, 'Jokulsarlon is a glacial lagoon that is said to be the site of an ancient Viking battle, where warriors fought for control of the area.'),
|
16 |
+
('Vatnajokull', 64.4150, -16.8333, 'Vatnajokull is Europe\'s largest glacier, and according to legend, it was formed by the tears of a grieving giantess.')
|
17 |
]
|
18 |
|
19 |
# Create a map centered on Iceland
|
|
|
23 |
for place in mythological_places:
|
24 |
folium.Marker(
|
25 |
location=[place[1], place[2]],
|
26 |
+
popup=f'{place[0]}<br>{place[3]}',
|
27 |
icon=folium.Icon(color='red')
|
28 |
).add_to(m)
|
29 |
|
|
|
32 |
m.location = [place_data[1], place_data[2]]
|
33 |
m.zoom_start = 13
|
34 |
folium_static(m)
|
35 |
+
for i in range(0, len(mythological_places), 3):
|
36 |
+
cols = st.columns(3)
|
37 |
+
for j in range(3):
|
38 |
+
if i + j < len(mythological_places):
|
39 |
+
with cols[j]:
|
40 |
+
if st.button(mythological_places[i + j][0]):
|
41 |
+
update_map(mythological_places[i + j])
|
42 |
+
folium_static(m)
|
43 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
44 |
|
45 |
+
|
|