Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -3,102 +3,68 @@ import folium
|
|
3 |
from streamlit_folium import folium_static
|
4 |
from folium.plugins import MarkerCluster
|
5 |
|
6 |
-
# Define
|
7 |
-
|
8 |
-
('
|
9 |
-
('
|
10 |
-
('
|
11 |
-
('
|
12 |
-
('
|
13 |
-
('
|
14 |
-
('
|
15 |
-
('
|
16 |
-
('
|
17 |
-
('
|
18 |
]
|
19 |
|
20 |
-
# Create a map centered on
|
21 |
-
m = folium.Map(location=[
|
22 |
|
23 |
-
# Add markers for each
|
24 |
marker_cluster = MarkerCluster().add_to(m)
|
25 |
-
for place in
|
26 |
folium.Marker(
|
27 |
location=[place[1], place[2]],
|
28 |
popup=f'<b>{place[0]}</b><br>{place[3]}',
|
29 |
-
icon=folium.Icon(color='
|
30 |
).add_to(marker_cluster)
|
31 |
|
32 |
# Add PolyLine for paths between markers with animation
|
33 |
-
locations = [place[1:3] for place in
|
34 |
path = folium.PolyLine(locations, color='blue', opacity=0.8, weight=5, smooth_factor=0.5).add_to(m)
|
35 |
-
folium.plugins.PolyLineTextPath(
|
|
|
|
|
|
|
|
|
|
|
|
|
36 |
|
37 |
folium_static(m)
|
38 |
|
39 |
st.markdown("""
|
40 |
-
#
|
41 |
-
|
42 |
-
The map above shows the location of various mythological places in Iceland. Hover over the markers to learn more about the stories behind each location.
|
43 |
-
|
44 |
""")
|
45 |
|
46 |
-
|
47 |
-
# Add markers for each mythological place
|
48 |
-
for place in mythological_places:
|
49 |
-
folium.Marker(
|
50 |
-
location=[place[1], place[2]],
|
51 |
-
popup=f'{place[0]}<br>{place[3]}',
|
52 |
-
icon=folium.Icon(color='red')
|
53 |
-
).add_to(m)
|
54 |
-
|
55 |
# Function to update the map when a button is clicked
|
56 |
def update_map(place_data):
|
57 |
m.location = [place_data[1], place_data[2]]
|
58 |
m.zoom_start = 13
|
59 |
folium_static(m)
|
60 |
|
61 |
-
|
62 |
-
for i in range(0, len(mythological_places), 3):
|
63 |
cols = st.columns(3)
|
64 |
for j in range(3):
|
65 |
-
if i + j < len(
|
66 |
with cols[j]:
|
67 |
-
if st.button(
|
68 |
-
update_map(
|
69 |
folium_static(m)
|
70 |
|
71 |
st.markdown("""
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
Hekla: Freyja, the goddess of love, hosted a witches' convention on Hekla to improve their matchmaking skills. The witches accidentally brewed a love potion so powerful that it caused the volcano to erupt with passion.
|
78 |
-
|
79 |
-
Elliðaey: The skoffin, tired of its isolation, devised a plan to hitch a ride off the island. It disguised itself as a mythical creature tour guide, successfully luring a boat full of curious tourists to Elliðaey.
|
80 |
-
|
81 |
-
Mývatn: Balder, the god of light, organized a contest for the supernatural beings of Mývatn. The prize was an all-expenses-paid vacation to sunny Valhalla. The competition was fierce, with participants showing off their most impressive magic tricks.
|
82 |
-
|
83 |
-
""")
|
84 |
-
|
85 |
-
|
86 |
-
st.markdown("""
|
87 |
-
🏝️ Elliðaey Island: Home of the Skoffin
|
88 |
-
Elliðaey is a stunning and isolated island located off the southern coast of Iceland 🇮🇸. The island boasts a picturesque landscape and unique wildlife, including a legendary creature known as the skoffin 🐱🦲.
|
89 |
-
|
90 |
-
Legend has it that the skoffin is a rare hybrid of a cat 🐱 and a fox 🦊, with a long tail and sharp teeth. The creature is incredibly elusive and is said to only appear to those who are pure of heart ❤️. Those who are lucky enough to spot the skoffin will be blessed with good luck and fortune 🍀.
|
91 |
-
|
92 |
-
Despite its mythical reputation, Elliðaey has a long history of human habitation. In the 10th century, Viking settlers used the island for fishing 🎣 and farming 🌾. Throughout the centuries, the island has been used for a variety of purposes, including as a place of exile and as a hideaway for smugglers 🏴☠️.
|
93 |
-
|
94 |
-
In the 1950s, a hunting lodge was built on the island, attracting wealthy hunters who came to Elliðaey to hunt puffins 🐧. However, the lodge was abandoned in the 1980s, and the island is now uninhabited 🏚️.
|
95 |
-
|
96 |
-
Today, Elliðaey remains a popular destination for hikers 🚶♀️ and bird watchers 🦜 who come to enjoy the island's natural beauty and abundant wildlife 🌿. The island's fascinating history, legends, and stories continue to capture the imagination of those who visit 💭. Who knows, you might even catch a glimpse of the elusive skoffin 🤩!
|
97 |
-
|
98 |
-
|
99 |
-
|
100 |
-
|
101 |
-
|
102 |
-
Regenerate response
|
103 |
""")
|
104 |
-
|
|
|
3 |
from streamlit_folium import folium_static
|
4 |
from folium.plugins import MarkerCluster
|
5 |
|
6 |
+
# Define California attractions data
|
7 |
+
california_attractions = [
|
8 |
+
('The Getty Center', 34.0780, -118.4741, 'The Getty Center is known for its architecture, gardens, and views overlooking Los Angeles.'),
|
9 |
+
('Venice Beach', 33.9850, -118.4695, 'Venice Beach is famous for its oceanfront boardwalk and Muscle Beach gym.'),
|
10 |
+
('Santa Monica Pier', 34.0104, -118.4962, 'Santa Monica Pier features a range of entertainment, dining, and shopping experiences.'),
|
11 |
+
('Golden Gate Bridge', 37.8199, -122.4783, 'The Golden Gate Bridge is a suspension bridge spanning the Golden Gate, the entrance to San Francisco Bay.'),
|
12 |
+
('Yosemite National Park', 37.8651, -119.5383, 'Known for its waterfalls, deep valleys, and iconic view of El Capitan.'),
|
13 |
+
('Disneyland', 33.8121, -117.9190, 'Disneyland Resort, located in Anaheim, is the first of two theme parks built under the Disneyland umbrella.'),
|
14 |
+
('Napa Valley', 38.5025, -122.2654, 'Napa Valley is known for its world-class wineries.'),
|
15 |
+
('Lake Tahoe', 39.0968, -120.0324, 'Lake Tahoe is a large freshwater lake known for its clear blue water.'),
|
16 |
+
('Universal Studios', 34.1381, -118.3534, 'Universal Studios Hollywood includes a movie-based theme park and studios that offers tours.'),
|
17 |
+
('Alcatraz Island', 37.8267, -122.4230, 'Alcatraz Island is home to the abandoned prison and the site of the oldest operating lighthouse.')
|
18 |
]
|
19 |
|
20 |
+
# Create a map centered on California
|
21 |
+
m = folium.Map(location=[36.7783, -119.4179], zoom_start=6)
|
22 |
|
23 |
+
# Add markers for each attraction and add them to a MarkerCluster
|
24 |
marker_cluster = MarkerCluster().add_to(m)
|
25 |
+
for place in california_attractions:
|
26 |
folium.Marker(
|
27 |
location=[place[1], place[2]],
|
28 |
popup=f'<b>{place[0]}</b><br>{place[3]}',
|
29 |
+
icon=folium.Icon(color='green')
|
30 |
).add_to(marker_cluster)
|
31 |
|
32 |
# Add PolyLine for paths between markers with animation
|
33 |
+
locations = [place[1:3] for place in california_attractions]
|
34 |
path = folium.PolyLine(locations, color='blue', opacity=0.8, weight=5, smooth_factor=0.5).add_to(m)
|
35 |
+
folium.plugins.PolyLineTextPath(
|
36 |
+
polyline=path,
|
37 |
+
text='\u25BA',
|
38 |
+
repeat=True,
|
39 |
+
offset=6,
|
40 |
+
attributes={'fill': 'blue', 'font-weight': 'bold', 'font-size': '12'}
|
41 |
+
).add_to(path)
|
42 |
|
43 |
folium_static(m)
|
44 |
|
45 |
st.markdown("""
|
46 |
+
# 🌞 California Attractions 🌴
|
47 |
+
The map above shows the location of various attractions in California. Hover over the markers to learn more about each location.
|
|
|
|
|
48 |
""")
|
49 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
50 |
# Function to update the map when a button is clicked
|
51 |
def update_map(place_data):
|
52 |
m.location = [place_data[1], place_data[2]]
|
53 |
m.zoom_start = 13
|
54 |
folium_static(m)
|
55 |
|
56 |
+
for i in range(0, len(california_attractions), 3):
|
|
|
57 |
cols = st.columns(3)
|
58 |
for j in range(3):
|
59 |
+
if i + j < len(california_attractions):
|
60 |
with cols[j]:
|
61 |
+
if st.button(california_attractions[i + j][0]):
|
62 |
+
update_map(california_attractions[i + j])
|
63 |
folium_static(m)
|
64 |
|
65 |
st.markdown("""
|
66 |
+
## 🍷 Napa Valley: The Wine Wonderland 🍇
|
67 |
+
Napa Valley, located in the heart of California, is synonymous with premium wines, fine dining, and breathtaking vistas. Not only is it a world-class wine-producing region, but it's also a paradise for foodies and outdoor enthusiasts. 🥂
|
68 |
+
Whether you're a sommelier or a casual wine drinker, Napa Valley offers a wide range of experiences, from vineyard tours and wine-tasting sessions to hot air balloon rides over the scenic countryside. 🎈
|
69 |
+
The valley is home to over 400 wineries, each with its own unique blend of grape varieties, production techniques, and flavors. 🍾
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
70 |
""")
|
|